Class: GraphAgent::Channels::BaseChannel
- Inherits:
-
Object
- Object
- GraphAgent::Channels::BaseChannel
show all
- Defined in:
- lib/graph_agent/channels/base_channel.rb
Constant Summary
collapse
- MISSING =
Object.new.freeze
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(key: "") ⇒ BaseChannel
Returns a new instance of BaseChannel.
10
11
12
|
# File 'lib/graph_agent/channels/base_channel.rb', line 10
def initialize(key: "")
@key = key
end
|
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
8
9
10
|
# File 'lib/graph_agent/channels/base_channel.rb', line 8
def key
@key
end
|
Instance Method Details
#available? ⇒ Boolean
32
33
34
35
36
37
|
# File 'lib/graph_agent/channels/base_channel.rb', line 32
def available?
get
true
rescue EmptyChannelError
false
end
|
#checkpoint ⇒ Object
22
23
24
25
26
|
# File 'lib/graph_agent/channels/base_channel.rb', line 22
def checkpoint
get
rescue EmptyChannelError
MISSING
end
|
#consume ⇒ Object
39
40
41
|
# File 'lib/graph_agent/channels/base_channel.rb', line 39
def consume
false
end
|
#copy ⇒ Object
47
48
49
|
# File 'lib/graph_agent/channels/base_channel.rb', line 47
def copy
from_checkpoint(checkpoint)
end
|
#finish ⇒ Object
43
44
45
|
# File 'lib/graph_agent/channels/base_channel.rb', line 43
def finish
false
end
|
#from_checkpoint(checkpoint) ⇒ Object
28
29
30
|
# File 'lib/graph_agent/channels/base_channel.rb', line 28
def from_checkpoint(checkpoint)
raise NotImplementedError.new("#{self.class}#from_checkpoint must be implemented")
end
|
#get ⇒ Object
14
15
16
|
# File 'lib/graph_agent/channels/base_channel.rb', line 14
def get
raise NotImplementedError.new("#{self.class}#get must be implemented")
end
|
#update(values) ⇒ Object
18
19
20
|
# File 'lib/graph_agent/channels/base_channel.rb', line 18
def update(values)
raise NotImplementedError.new("#{self.class}#update must be implemented")
end
|