Skip to content

Commit 1910f04

Browse files
committed
bug #12209 [Messenger] Use new TransportInterface (OskarStark)
This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] Use new TransportInterface Fixes #11972 <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 2f61ef2 [Messenger] Use new TransportInterface
2 parents 7ab222a + 2f61ef2 commit 1910f04

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

messenger/custom-transport.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,31 @@ DSN. You will need a transport factory::
2828
}
2929
}
3030

31-
The transport object needs to implement the ``TransportInterface`` (which simply combines
32-
the ``SenderInterface`` and ``ReceiverInterface``). It will look like this::
31+
The transport object needs to implement the
32+
:class:`Symfony\\Component\\Messenger\\Transport\\TransportInterface`
33+
(which combines the :class:`Symfony\\Component\\Messenger\\Transport\\Sender\\SenderInterface`
34+
and :class:`Symfony\\Component\\Messenger\\Transport\\Receiver\\ReceiverInterface`)::
35+
36+
use Symfony\Component\Messenger\Envelope;
3337

3438
class YourTransport implements TransportInterface
3539
{
36-
public function send(Envelope $envelope): Envelope
40+
public function get(): iterable
3741
{
3842
// ...
3943
}
4044

41-
public function receive(callable $handler): void
45+
public function ack(Envelope $envelope): void
4246
{
4347
// ...
4448
}
4549

46-
public function stop(): void
50+
public function reject(Envelope $envelope): void
51+
{
52+
// ...
53+
}
54+
55+
public function send(Envelope $envelope): Envelope
4756
{
4857
// ...
4958
}

0 commit comments

Comments
 (0)