Skip to content

Instantly share code, notes, and snippets.

@chrisguitarguy
Created June 3, 2015 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisguitarguy/f0d59a4146b406191462 to your computer and use it in GitHub Desktop.
Save chrisguitarguy/f0d59a4146b406191462 to your computer and use it in GitHub Desktop.
<?php
class Middleware
{
public function handle($command, callable $next)
{
if ($command instanceof QueuedCommand) {
return $next($command->getCommand());
}
if ($command instanceof Message) {
$this->producer->produce(new QueuedCommand($command));
return;
}
return $next($comamnd);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment