Skip to content

Commit b1d311e

Browse files
committed
[Messenger] Use new TransportInterface
Fixes #11972
1 parent 2168de5 commit b1d311e

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)