Class: Server::Server
- Includes:
- InstanceMethods
- Defined in:
- lib/server/server.rb
Overview
The Server class sets up the netty server.
Constant Summary collapse
- CHANNEL_TYPE =
Java::io.netty.channel.socket.nio.NioServerSocketChannel.java_class
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}, *handlers, &block) ⇒ Server
constructor
A new instance of Server.
Methods included from InstanceMethods
#<<, #add_listener, #bootstrap, #boss_group, #channel_group, #channel_initializer, #channel_type, #configure_handlers, #keep_alive, #logging_handler, #max_queued_incoming_connections, #port, #replace_listeners, #run, #shutdown, #stop, #worker_group
Methods included from DefaultHandler
#channel_active, #exception_caught, #message_received
Constructor Details
#initialize(options = {}, *handlers, &block) ⇒ Server
Returns a new instance of Server.
27 28 29 30 31 32 33 34 |
# File 'lib/server/server.rb', line 27 def initialize( = {}, *handlers, &block) raise ArgumentError, 'Parameter may not be nil: options' if .nil? @options = ::Server.server_config.merge() configure_handlers(*(handlers.empty? && block.nil? ? [self] : handlers), &block) ensure listeners = channel_initializer.default_handler.listeners log.trace "##{__method__} listeners: #{listeners}" end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
25 26 27 |
# File 'lib/server/server.rb', line 25 def @options end |