Module: Anycable
- Defined in:
- lib/anycable.rb,
lib/anycable/config.rb,
lib/anycable/pubsub.rb,
lib/anycable/server.rb,
lib/anycable/socket.rb,
lib/anycable/version.rb,
lib/anycable/rpc/rpc_pb.rb,
lib/anycable/rpc_handler.rb,
lib/anycable/rpc/rpc_services_pb.rb,
lib/anycable/handler/exceptions_handling.rb
Overview
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength
Defined Under Namespace
Modules: Handler, RPC, Server
Classes: Config, PubSub, RPCHandler, Socket
Constant Summary
collapse
- VERSION =
"0.5.0"
- ConnectionRequest =
Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.ConnectionRequest").msgclass
- ConnectionResponse =
Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.ConnectionResponse").msgclass
- CommandMessage =
Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.CommandMessage").msgclass
- CommandResponse =
Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.CommandResponse").msgclass
- DisconnectRequest =
Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.DisconnectRequest").msgclass
- DisconnectResponse =
Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.DisconnectResponse").msgclass
- Status =
Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.Status").enummodule
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.connection_factory ⇒ Object
Provide connection factory which is a callable object with build a Connection object
19
20
21
|
# File 'lib/anycable.rb', line 19
def connection_factory
@connection_factory
end
|
Class Method Details
.broadcast(channel, payload) ⇒ Object
Broadcast message to the channel
51
52
53
|
# File 'lib/anycable.rb', line 51
def broadcast(channel, payload)
pubsub.broadcast(channel, payload)
end
|
.config ⇒ Object
33
34
35
|
# File 'lib/anycable.rb', line 33
def config
@config ||= Config.new
end
|
37
38
39
|
# File 'lib/anycable.rb', line 37
def configure
yield(config) if block_given?
end
|
.error_handlers ⇒ Object
41
42
43
44
|
# File 'lib/anycable.rb', line 41
def error_handlers
return @error_handlers if instance_variable_defined?(:@error_handlers)
@error_handlers = []
end
|
.logger ⇒ Object
25
26
27
28
29
30
31
|
# File 'lib/anycable.rb', line 25
def logger
return @logger if instance_variable_defined?(:@logger)
log_output = Anycable.config.log_file || STDOUT
@logger = Logger.new(log_output).tap do |logger|
logger.level = Anycable.config.log_level
end
end
|
.logger=(logger) ⇒ Object
21
22
23
|
# File 'lib/anycable.rb', line 21
def logger=(logger)
@logger = logger
end
|
.pubsub ⇒ Object
46
47
48
|
# File 'lib/anycable.rb', line 46
def pubsub
@pubsub ||= PubSub.new
end
|