Class: Bane::Behaviors::CloseAfterPause

Inherits:
BasicBehavior show all
Defined in:
lib/bane/behaviors.rb

Overview

Accepts a connection, pauses a fixed duration, then closes the connection.

Options:

- duration: The number of seconds to wait before disconnect.  Default: 30

Instance Method Summary collapse

Methods inherited from BasicBehavior

inherited, simple_name

Instance Method Details

#serve(io, options) ⇒ Object



38
39
40
41
42
# File 'lib/bane/behaviors.rb', line 38

def serve(io, options)
  options = {:duration => 30}.merge(options)

  sleep(options[:duration])
end