Class: Concurrent::Actor::Envelope
- Inherits:
-
Object
- Object
- Concurrent::Actor::Envelope
show all
- Includes:
- TypeCheck
- Defined in:
- lib/concurrent/actor/envelope.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from TypeCheck
#Child!, #Child?, #Match!, #Match?, #Type!, #Type?
Constructor Details
#initialize(message, future, sender, address) ⇒ Envelope
Returns a new instance of Envelope.
17
18
19
20
21
22
|
# File 'lib/concurrent/actor/envelope.rb', line 17
def initialize(message, future, sender, address)
@message = message
@future = Type! future, Edge::CompletableFuture, NilClass
@sender = Type! sender, Reference, Thread
@address = Type! address, Reference
end
|
Instance Attribute Details
#address ⇒ Object
15
|
# File 'lib/concurrent/actor/envelope.rb', line 15
attr_reader :message, :future, :sender, :address
|
15
|
# File 'lib/concurrent/actor/envelope.rb', line 15
attr_reader :message, :future, :sender, :address
|
#message ⇒ Object
15
16
17
|
# File 'lib/concurrent/actor/envelope.rb', line 15
def message
@message
end
|
15
|
# File 'lib/concurrent/actor/envelope.rb', line 15
attr_reader :message, :future, :sender, :address
|
Instance Method Details
#address_path ⇒ Object
32
33
34
|
# File 'lib/concurrent/actor/envelope.rb', line 32
def address_path
address.path
end
|
#reject!(error) ⇒ Object
36
37
38
|
# File 'lib/concurrent/actor/envelope.rb', line 36
def reject!(error)
future.fail error unless future.nil?
end
|
#sender_path ⇒ Object
24
25
26
27
28
29
30
|
# File 'lib/concurrent/actor/envelope.rb', line 24
def sender_path
if sender.is_a? Reference
sender.path
else
sender.to_s
end
end
|