Class: UV::Connection Abstract
- Inherits:
-
Object
- Object
- UV::Connection
- Defined in:
- lib/uv-rays/connection.rb
Overview
This class is abstract.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#using_tls ⇒ Object
readonly
Returns the value of attribute using_tls.
Instance Method Summary collapse
-
#close_connection(*args) ⇒ Object
Compatible with TCP.
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
-
#on_read(data, *args) ⇒ Object
user to define.
- #pause ⇒ Object
- #paused? ⇒ Boolean
- #post_init(*args) ⇒ Object
- #resume ⇒ Object
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
33 34 35 36 37 |
# File 'lib/uv-rays/connection.rb', line 33 def initialize @send_queue = [] @paused = false @using_tls = false end |
Instance Attribute Details
#using_tls ⇒ Object (readonly)
Returns the value of attribute using_tls.
31 32 33 |
# File 'lib/uv-rays/connection.rb', line 31 def using_tls @using_tls end |
Instance Method Details
#close_connection(*args) ⇒ Object
Compatible with TCP
54 55 56 |
# File 'lib/uv-rays/connection.rb', line 54 def close_connection(*args) @transport.close end |
#on_read(data, *args) ⇒ Object
user to define
58 59 |
# File 'lib/uv-rays/connection.rb', line 58 def on_read(data, *args) # user to define end |
#pause ⇒ Object
39 40 41 42 |
# File 'lib/uv-rays/connection.rb', line 39 def pause @paused = true @transport.stop_read end |
#paused? ⇒ Boolean
44 45 46 |
# File 'lib/uv-rays/connection.rb', line 44 def paused? @paused end |
#post_init(*args) ⇒ Object
61 62 |
# File 'lib/uv-rays/connection.rb', line 61 def post_init(*args) end |
#resume ⇒ Object
48 49 50 51 |
# File 'lib/uv-rays/connection.rb', line 48 def resume @paused = false @transport.start_read end |