forked from php-enqueue/enqueue-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProducerInterface.php
More file actions
27 lines (23 loc) · 798 Bytes
/
Copy pathProducerInterface.php
File metadata and controls
27 lines (23 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
namespace Enqueue\Client;
use Enqueue\Rpc\Promise;
interface ProducerInterface
{
/**
* The message could be pretty much everything as long as you have a client extension that transforms a body to string on onPreSendEvent.
*
* @param string|array|Message $message
*
* @throws \Exception
*/
public function sendEvent(string $topic, $message): void;
/**
* The message could be pretty much everything as long as you have a client extension that transforms a body to string on onPreSendCommand.
* The promise is returned if needReply argument is true.
*
* @param string|array|Message $message
*
* @throws \Exception
*/
public function sendCommand(string $command, $message, bool $needReply = false): ?Promise;
}