123456789_123456789_123456789_123456789_123456789_

Class: Concurrent::Actor::Envelope

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, TypeCheck
Inherits: Object
Defined in: lib/concurrent-ruby-edge/concurrent/actor/envelope.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(message, future, sender, address) ⇒ Envelope

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/actor/envelope.rb', line 19

def initialize(message, future, sender, address)
  @message = message
  @future  = Type! future, Promises::ResolvableFuture, NilClass
  @sender  = Type! sender, Reference, Thread
  @address = Type! address, Reference
end

Instance Attribute Details

#address (readonly)

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/actor/envelope.rb', line 17

attr_reader :message, :future, :sender, :address

#futureEdge::Future (readonly)

Returns:

  • (Edge::Future)

    a future which becomes resolved after message is processed

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/actor/envelope.rb', line 17

attr_reader :message, :future, :sender, :address

#messageObject (readonly)

Returns:

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/actor/envelope.rb', line 17

attr_reader :message, :future, :sender, :address

#senderReference, Thread (readonly)

Returns:

  • (Reference, Thread)

    an actor or thread sending the message

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/actor/envelope.rb', line 17

attr_reader :message, :future, :sender, :address

Instance Method Details

#address_path

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/actor/envelope.rb', line 34

def address_path
  address.path
end

#reject!(error)

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/actor/envelope.rb', line 38

def reject!(error)
  future.reject error unless future.nil?
end

#sender_path

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/actor/envelope.rb', line 26

def sender_path
  if sender.is_a? Reference
    sender.path
  else
    sender.to_s
  end
end