Class: Farce::Local::Publisher

Inherits:
Abstract::Publisher show all
Includes:
Shareable::Unfreezable
Defined in:
lib/farce/local/publisher.rb

Overview

Local variant of Publisher.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Shareable

#ractor_shareable?

Methods inherited from Abstract::Publisher

#closed?, #publish, #subscribe, #subscribed?, #subscription_for, #unsubscribe

Methods included from Internal::Noncopyable

#duplicable?

Constructor Details

#initialize(scope: :ractor) ⇒ Publisher

Returns a new instance of Publisher.

Raises:

  • (ArgumentError)


17
18
19
20
21
# File 'lib/farce/local/publisher.rb', line 17

def initialize(*, scope: :ractor)
  raise ArgumentError, "Invalid scope: #{scope.inspect}" unless Farce::SCOPES.include?(scope)
  @scope = scope
  super(*)
end

Instance Attribute Details

#scope ⇒ Symbol (readonly)

The scope with independent contents.

Returns:

  • (Symbol) —

    The configured scope name.



13
14
15
# File 'lib/farce/local/publisher.rb', line 13

def scope
  @scope
end