Download the PHP package pcz/deferred-kdyby-events without Composer

On this page you can find all versions of the php package pcz/deferred-kdyby-events. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package deferred-kdyby-events

pcz/deferred-kdyby-events

deferred events extension for Nette framework (using kdyby/events & kdyby/doctrine) aneb kdyby až bude Bavorov...

This extension of kdyby/events event system provides support of deferred events in your appliaction. Two following basic types of deferred events are implemented:

Requirements

Installation

Introduction

Each event is represented by its event class. It must extend one of the following base classes: pcz\DeferredKdybyEvents\DeferredEvent or pcz\DeferredKdybyEvents\GroupedDeferredEvent. In fact, each event class is an ORM Entity, so don't forget to use ORM Annotations on class attributes. Usage of MTI (multi-table-inheritance) inheritance type causes that each event is represented by 1 table in database schema. It's also necessary to update database schema after adding new event class.

Examples

Let's start with the simple deferred event type, the following example shows implementation of planned change of product price:

The event class

Event creation

Event handling

.. that's it:-) Now, let's see some more interesting scenario. An internal message system is part of your awesome app and you want to send a notification when user receives a message. But you don't want to spam user's mailbox, so the notification will be delayed. If another message is received during the delay period, user will still receive the single notification.

Note the getGroupKey() method, it must be implemented when overriding the GroupedDeferredEvent class. It's necessary because it defines the grouping key. Also the @Keeping annotation is important, it will be discussed later. Another example is removing inactive chat member from a chat room. Notice the lack of the @Keeping annotation and the getGroupKey() method.

New event then would be created every time user sends a chat message. If the delay period would be for example 48 hours (eg. call like $event = new RemoveUserFromRoomEvent((new \DateTime())->add(new \DateInterval('PT48H')), ...) would be used), user would be removed from a chat room that hasn't participated to for 48 hours. When new event is persisted, all other waiting events with the same groupKey will be suspended.

But it might not be the proper behavior for the first case (notification example). If someone send me a message every 5 minutes, i'll never receive a notification, because the created event will always "overwrite" the last waiting one. In such cases, use the @Keeping annotation. It changes the strategy of grouping - the closest event will be kept and all succeeding events will be suspended.

Thanks & enjoy & a big round of applause for Kdyby extensions


All versions of deferred-kdyby-events with dependencies

PHP Build Version
Package Version
Requires kdyby/events Version >=2.4
kdyby/doctrine Version >=2.3
kdyby/console Version >=2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pcz/deferred-kdyby-events contains the following files

Loading the files please wait ....