Skip to content

Commit

Permalink
Publisher interface
Browse files Browse the repository at this point in the history
  • Loading branch information
solcloud committed Jun 8, 2022
1 parent ed49053 commit d127ee7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/IPublisher.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Solcloud\Consumer;

interface IPublisher
{
public function send(array $data, QueueRoute $route, array $meta = []): void;

}
13 changes: 13 additions & 0 deletions src/NullPublisher.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Solcloud\Consumer;

class NullPublisher implements IPublisher
{

public function send(array $data, QueueRoute $route, array $meta = []): void
{
// do nothing
}

}
2 changes: 1 addition & 1 deletion src/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use PhpAmqpLib\Connection\AbstractConnection as Connection;
use PhpAmqpLib\Message\AMQPMessage as Message;

class Publisher
class Publisher implements IPublisher
{

/**
Expand Down

0 comments on commit d127ee7

Please sign in to comment.