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.cr

Instance Method Summary

Instance Method Detail

abstract def publish(event_name : String, data : Hash(String, String)) : Nil #

Publishes data to the broker.


[View source]
abstract def subscribe(event_name : String) : Nil #

Subscribes the broker to an event.


[View source]
def subscribe(event_names : Array(String)) : Nil #

Subscribes the broker to multiple events.


[View source]