class Vissen::Input::Subscription

Whenever a callable object wants to receive messages from a broker it is wrapped inside of a subscription. A subscription is a basic immutable value object with a minimal api that keeps track of three things: a Matcher, a callable handler and a numeric priority.

Attributes

priority[R]

@return [Integer] the subscription priority.

Public Class Methods

new(matcher, handler, priority) click to toggle source

@param matcher [#match?] the matcher to use when filtering messages. @param handler [#call] the target of the subscription. @param priority [Integer] the priority of the subscription relative

other subscriptions.
# File lib/vissen/input/subscription.rb, line 36
def initialize(matcher, handler, priority)
  @matcher  = matcher
  @handler  = handler
  @priority = priority

  freeze
end