Skip to content

Commit 0c73f13

Browse files
committed
Introduce Producer
1 parent b8a1d2b commit 0c73f13

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/Encoder.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Mammatus\Queue\Contracts;
6+
7+
interface Encoder
8+
{
9+
/** @param array<string, mixed> $payload */
10+
public function encode(array $payload): string;
11+
12+
/** @return array<string, mixed> */
13+
public function decode(string $payload): array;
14+
}

src/Producer.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Mammatus\Queue\Contracts;
6+
7+
use Interop\Queue\Producer as InteropProducer;
8+
use Mammatus\Queue\Contracts\Work;
9+
use Mammatus\Queue\Generated\Hydrator;
10+
use Mammatus\Queue\Generated\WorkQueueMap;
11+
12+
use Mammatus\Queue\Message;
13+
use Mammatus\Queue\Queue;
14+
use function json_encode;
15+
16+
interface Producer
17+
{
18+
public function send(Work $work): void;
19+
}

0 commit comments

Comments
 (0)