coka/semaphore-messenger

The Semaphore Transport allows you to send and receive messages on System V message queues.

1.1.0 2020-07-09 13:30 UTC

This package is auto-updated.

Last update: 2024-05-09 21:59:46 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads SensioLabsInsight Travis CI

The Semaphore Transport allows you to send and receive messages on System V message queues. The semaphore transport configuration looks like this :

# .env
MESSENGER_TRANSPORT_DSN=semaphore://%kernel.project_dir%/.env
# Full DSN Example
MESSENGER_TRANSPORT_DSN=semaphore://%kernel.project_dir%/.env?project=M&message_type=1&message_max_size=1024

A number of options can be configured via the DSN or via the options key under the transport in messenger.yaml:

Option Description Default
path Pathname to create System V IPC key
project Project identifier to create System V IPC key M
message_type The type of message to send 1
message_max_size The maximum size in bytes of a message if the message is larger than this size, an exception will be thrown 131072
auto_setup Enable or not the auto-setup of queue true

This extension is not available on Windows platforms.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require coka/semaphore-messenger

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Configuration

You can register the semaphore transport factory to be able to use it via a DSN in the Symfony application.

Register the Semaphore Transport Factory

# config/services.yaml
services:
    Oka\Messenger\Transport\Semaphore\SemaphoreTransportFactory:
        tags: [messenger.transport_factory]

Use your Transport

Within the framework.messenger.transports.* configuration, create your named transport using your own DSN:

# config/packages/messenger.yaml
framework:
    messenger:
        transports:
            yours: 'semaphore://...'

Copyright and License

The coka/semaphore-messenger library is copyright © Baidai Cedrick Oka https://github.com/CedrickOka and licensed for use under the MIT License (MIT). Please see LICENSE for more information.

source release license build downloads