Class: JRPC::Transport::Base
- Inherits:
-
Object
- Object
- JRPC::Transport::Base
show all
- Defined in:
- lib/jrpc/transport/base.rb
Defined Under Namespace
Classes: ConnectionError, Error, MalformedFrame, Timeout
Instance Method Summary
collapse
Constructor Details
#initialize(server, **options) ⇒ Base
Returns a new instance of Base.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/jrpc/transport/base.rb', line 14
def initialize(server, **options)
@server = server
@connect_timeout = options.fetch(:connect_timeout, 60)
@connect_attempt_timeout = options.fetch(:connect_attempt_timeout, nil)
@connect_retry_count = options.fetch(:connect_retry_count, 0)
@connect_retry_interval = options.fetch(:connect_retry_interval, 0.5)
@write_timeout = options.fetch(:write_timeout, nil)
@tcp_md5_pass = options.fetch(:tcp_md5_pass, nil)
end
|
Instance Method Details
#close ⇒ Object
49
50
51
|
# File 'lib/jrpc/transport/base.rb', line 49
def close
raise NotImplementedError
end
|
#closed? ⇒ Boolean
53
54
55
|
# File 'lib/jrpc/transport/base.rb', line 53
def closed?
raise NotImplementedError
end
|
#connect ⇒ Object
Abstract interface. Subclasses must implement every method below; the bodies only exist to fail loudly if one is forgotten, so they carry no logic worth covering and are excluded from coverage via :nocov:. :nocov:
33
34
35
|
# File 'lib/jrpc/transport/base.rb', line 33
def connect
raise NotImplementedError
end
|
#read_frame(timeout:) ⇒ Object
41
42
43
|
# File 'lib/jrpc/transport/base.rb', line 41
def read_frame(timeout:)
raise NotImplementedError
end
|
#socket ⇒ Object
57
58
59
|
# File 'lib/jrpc/transport/base.rb', line 57
def socket
raise NotImplementedError
end
|
#try_read_frame ⇒ Object
45
46
47
|
# File 'lib/jrpc/transport/base.rb', line 45
def try_read_frame
raise NotImplementedError
end
|
#write_frame(bytes, timeout:) ⇒ Object
37
38
39
|
# File 'lib/jrpc/transport/base.rb', line 37
def write_frame(bytes, timeout:)
raise NotImplementedError
end
|