Class: ActionCable::SubscriptionAdapter::Base

Inherits:
Object
  • Object
show all
Defined in:
actioncable/lib/action_cable/subscription_adapter/base.rb

Direct Known Subclasses

Inline, PostgreSQL, Redis

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server) ⇒ Base

Returns a new instance of Base.



8
9
10
11
# File 'actioncable/lib/action_cable/subscription_adapter/base.rb', line 8

def initialize(server)
  @server = server
  @logger = @server.logger
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger



6
7
8
# File 'actioncable/lib/action_cable/subscription_adapter/base.rb', line 6

def logger
  @logger
end

#serverObject (readonly)

Returns the value of attribute server



6
7
8
# File 'actioncable/lib/action_cable/subscription_adapter/base.rb', line 6

def server
  @server
end

Instance Method Details

#broadcast(channel, payload) ⇒ Object

Raises:

  • (NotImplementedError)


13
14
15
# File 'actioncable/lib/action_cable/subscription_adapter/base.rb', line 13

def broadcast(channel, payload)
  raise NotImplementedError
end

#identifierObject



29
30
31
# File 'actioncable/lib/action_cable/subscription_adapter/base.rb', line 29

def identifier
  @server.config.cable[:id] ||= "ActionCable-PID-#{$$}"
end

#shutdownObject

Raises:

  • (NotImplementedError)


25
26
27
# File 'actioncable/lib/action_cable/subscription_adapter/base.rb', line 25

def shutdown
  raise NotImplementedError
end

#subscribe(channel, message_callback, success_callback = nil) ⇒ Object

Raises:

  • (NotImplementedError)


17
18
19
# File 'actioncable/lib/action_cable/subscription_adapter/base.rb', line 17

def subscribe(channel, message_callback, success_callback = nil)
  raise NotImplementedError
end

#unsubscribe(channel, message_callback) ⇒ Object

Raises:

  • (NotImplementedError)


21
22
23
# File 'actioncable/lib/action_cable/subscription_adapter/base.rb', line 21

def unsubscribe(channel, message_callback)
  raise NotImplementedError
end