Download the PHP package webit/message-bus-sf-event-dispatcher without Composer

On this page you can find all versions of the php package webit/message-bus-sf-event-dispatcher. 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 message-bus-sf-event-dispatcher

Message Bus - Symfony Event Dispatcher Infrastructure

Symfony Event Dispatcher infrastructure for Message Bus

Installation

Usage

Publisher integration

To publish Message via Symfony Event Dispatcher use EventDispatcherPublisher

MessageBusEventFactory

You need to tell the EventDispatcherPublisher how to translate your Message into the event name and event object of Symfony Event Dispatcher. Implement and configure MessageBusEventFactory.

MessageBusEventFactory: Example

Let's say you're going to publish messages of two types: type-1 and type-2 and you want to map then to two different Events of Symfony Event Dispatcher Event1 and Event2.

Option 1: implement MessageBusEventFactory

Then combine both factories together

Option 2: Use GenericMessageBusEventFactory and implement its dependencies

then

Option 3: Implement your own strategy

As EventDispatcherPublisher expects an interface MessageBusEventFactory as a dependency, you can provide your own implementation for it. Also you can provide and combine inner interfaces used by GenericMessageBusEventFactory: SymfonyEventFactory and EventNameResolver.

If you like JMSSerializer to produce Symfony Event object, use JMSSerializerSymfonyEventFactory.

Putting the stuff together

Event consumption

Why to consume events at all?

  1. Dispatches public events to the Message Bus If you want some events to be public and other applications be able to listen to them, use PublishingConsumer to publish them using different infrastructure (AMQP for example).

  2. Asynchronous events processing If you want some events to be processed asynchronously, use PublishingConsumer to publish them using different infrastructure (AMQP for example), then listen for them.

To consume Message created from Event of Symfony Event Dispatcher, use EventConsumingListener. It requires MessageFromEventFactory and Consumer to be provided.

GenericMessageFromEventFactory

It requires EventSerialiser and MessageTypeResolver (by default uses event name)

Option 1: Implement own EventSerialiser
Option 2: Use JMSSerializer to Serialise Event

Use FromMessageAwareEventMessageFromEventFactory

Your event can optionally implements MessageAwareEvent interface.

Then you can use FromMessageAwareEventMessageFromEventFactory to produce an event

Putting all together

Configure MessageFromEventFactory

Create a listener

Register the listener on Symfony Event Dispatcher for all required events

Running tests

Install dependencies with composer


All versions of message-bus-sf-event-dispatcher with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
webit/message-bus Version ^1.0.0
symfony/event-dispatcher Version ^3.0|^4.0
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 webit/message-bus-sf-event-dispatcher contains the following files

Loading the files please wait ....