module Servo::Broker::BrokerInterface
Overview
Interface for Servo brokers.
A broker is the middle-man between the gateway and your application. Spectacles currently offers two brokers : Redis and AMQP. Servo only implements a redis broker however an AMQP broker can be implemented by including this interface and implementing the abstract methods.
Direct including types
Defined in:
broker/broker_interface.crInstance Method Summary
-
#publish(event_name : String, data : Hash(String, String)) : Nil
Publishes data to the broker.
-
#subscribe(event_name : String) : Nil
Subscribes the broker to an event.
-
#subscribe(event_names : Array(String)) : Nil
Subscribes the broker to multiple events.
Instance Method Detail
abstract
def publish(event_name : String, data : Hash(String, String)) : Nil
#
Publishes data to the broker.