Module: Raktr::Connection::Callbacks
- Included in:
- Raktr::Connection
- Defined in:
- lib/raktr/connection/callbacks.rb
Overview
Callbacks to be invoked per event.
Instance Method Summary collapse
-
#on_attach ⇒ Object
abstract
Called after the connection has been attached to a #raktr.
-
#on_close(reason) ⇒ Object
abstract
Called when the connection gets closed.
-
#on_connect ⇒ Object
abstract
Called after the connection has been established.
-
#on_detach ⇒ Object
abstract
Called right the connection is detached from the #raktr.
-
#on_flush ⇒ Object
abstract
Called after the buffered data have all been sent to the peer.
-
#on_read(data) ⇒ Object
abstract
Called when data are available.
-
#on_write ⇒ Object
abstract
Called after each #write call.
Instance Method Details
#on_attach ⇒ Object
Called after the connection has been attached to a Raktr::Connection#raktr.
26 27 |
# File 'lib/raktr/connection/callbacks.rb', line 26 def on_attach end |
#on_close(reason) ⇒ Object
If a connection could not be established no Raktr::Connection#socket may be available.
Called when the connection gets closed.
44 45 |
# File 'lib/raktr/connection/callbacks.rb', line 44 def on_close( reason ) end |
#on_connect ⇒ Object
Called after the connection has been established.
20 21 |
# File 'lib/raktr/connection/callbacks.rb', line 20 def on_connect end |
#on_detach ⇒ Object
Called right the connection is detached from the Raktr::Connection#raktr.
32 33 |
# File 'lib/raktr/connection/callbacks.rb', line 32 def on_detach end |
#on_flush ⇒ Object
Called after the buffered data have all been sent to the peer.
65 66 |
# File 'lib/raktr/connection/callbacks.rb', line 65 def on_flush end |
#on_read(data) ⇒ Object
Called when data are available.
53 54 |
# File 'lib/raktr/connection/callbacks.rb', line 53 def on_read( data ) end |
#on_write ⇒ Object
Called after each Raktr::Connection#write call.
59 60 |
# File 'lib/raktr/connection/callbacks.rb', line 59 def on_write end |