Class: AnyCable::Rails::Server

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/anycable/rails/next/connection.rb

Overview

Wrap ActionCable.server to provide a custom executor and a pubsub adapter

Defined Under Namespace

Classes: Executor, PubSub

Constant Summary collapse

EXECUTOR =

A signleton executor for all connections

Executor.new.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#executorObject

Returns the value of attribute executor.



59
60
61
# File 'lib/anycable/rails/next/connection.rb', line 59

def executor
  @executor
end

#pubsubObject

Returns the value of attribute pubsub.



59
60
61
# File 'lib/anycable/rails/next/connection.rb', line 59

def pubsub
  @pubsub
end

Class Method Details

.for(server, socket) ⇒ Object



61
62
63
64
65
66
# File 'lib/anycable/rails/next/connection.rb', line 61

def self.for(server, socket)
  new(server).tap do |srv|
    srv.executor = EXECUTOR
    srv.pubsub = PubSub.new(socket)
  end
end