Skip to content

[Messenger] Use new TransportInterface #12209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions messenger/custom-transport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,31 @@ DSN. You will need a transport factory::
}
}

The transport object needs to implement the ``TransportInterface`` (which simply combines
the ``SenderInterface`` and ``ReceiverInterface``). It will look like this::
The transport object needs to implement the
:class:`Symfony\\Component\\Messenger\\Transport\\TransportInterface`
(which combines the :class:`Symfony\\Component\\Messenger\\Transport\\Sender\\SenderInterface`
and :class:`Symfony\\Component\\Messenger\\Transport\\Receiver\\ReceiverInterface`)::

use Symfony\Component\Messenger\Envelope;

class YourTransport implements TransportInterface
{
public function send(Envelope $envelope): Envelope
public function get(): iterable
{
// ...
}

public function receive(callable $handler): void
public function ack(Envelope $envelope): void
{
// ...
}

public function stop(): void
public function reject(Envelope $envelope): void
{
// ...
}

public function send(Envelope $envelope): Envelope
{
// ...
}
Expand Down