/**
  * @param $message
  *
  * @return callable|void
  */
 protected function getHandler($message)
 {
     try {
         $handler = $this->messageHandlerResolver->resolve($message);
     } catch (UndefinedCallable $e) {
         try {
             $handler = $this->asynchronousMessageHandlerResolver->resolve($message);
             if (is_array($handler)) {
                 return current($handler);
             }
         } catch (UndefinedCallable $e) {
         }
     }
 }
 /**
  * Handles the message by resolving the correct message handler and calling it.
  *
  * {@inheritdoc}
  */
 public function handle($message, callable $next)
 {
     $handler = $this->messageHandlerResolver->resolve($message);
     call_user_func($handler, $message);
     $next($message);
 }