abstract class UnicastMessage extends Message
Base class to define a new message with one single destination process (unicast).
Each new message must be a subclass of UnicastMessage, of BroadcastMessage, or of MulticastMessage. For a protocols to add information to an existing message, it is necessary to define instead a wrapper message; i.e., a subclass of Wrapper.
Typical declarations of top-level messages:
case class Token (from: PID, to: PID) extends UnicastMessage case class Ack (from: PID, to: PID) extends UnicastMessage case class FIFO (from: PID, to: PID, sn: Long, payload: Message) extends UnicastMessage
The fields to and from must be defined. Thus, to work properly, it is essential that new
messages are created with from and to arguments as above.
Instantiation of top-level messages:
import neko._ val next = me.map { i => (i+1) % N } val m1 = Token(me, next) val m2 = Ack(me, next) val m3 = FIFO(me, next, seqnum, msg)
Defining actual messages as a case class is a recommended practice and highly convenient since
it allows for pattern matching without requiring any additional work.
def onReceive = { case Token(from,_) if from < me => // e.g., getting a token from a process with lower id case FIFO(_,_,sn,m) if deliverNext == sn => deliverNext += 1 DELIVER(m) }
- Alphabetic
- By Inheritance
- UnicastMessage
- Message
- Event
- Immutable
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
-  new UnicastMessage()
Abstract Value Members
Concrete Value Members
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        !=(arg0: Any): Boolean
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        ##(): Int
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        +(other: String): String
      
      
      - Implicit
- This member is added by an implicit conversion from UnicastMessage to any2stringadd[UnicastMessage] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        ->[B](y: B): (UnicastMessage, B)
      
      
      - Implicit
- This member is added by an implicit conversion from UnicastMessage to ArrowAssoc[UnicastMessage] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        ==(arg0: Any): Boolean
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        asInstanceOf[T0]: T0
      
      
      - Definition Classes
- Any
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        clone(): AnyRef
      
      
      - Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        destinations: Set[PID]
      
      
      The set of destination processes (well, their ID anyways). The set of destination processes (well, their ID anyways). - returns
- the set of destination processes. 
 - Definition Classes
- UnicastMessage → Message
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        ensuring(cond: (UnicastMessage) ⇒ Boolean, msg: ⇒ Any): UnicastMessage
      
      
      - Implicit
- This member is added by an implicit conversion from UnicastMessage to Ensuring[UnicastMessage] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        ensuring(cond: (UnicastMessage) ⇒ Boolean): UnicastMessage
      
      
      - Implicit
- This member is added by an implicit conversion from UnicastMessage to Ensuring[UnicastMessage] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        ensuring(cond: Boolean, msg: ⇒ Any): UnicastMessage
      
      
      - Implicit
- This member is added by an implicit conversion from UnicastMessage to Ensuring[UnicastMessage] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        ensuring(cond: Boolean): UnicastMessage
      
      
      - Implicit
- This member is added by an implicit conversion from UnicastMessage to Ensuring[UnicastMessage] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        eq(arg0: AnyRef): Boolean
      
      
      - Definition Classes
- AnyRef
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        equals(arg0: Any): Boolean
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        formatted(fmtstr: String): String
      
      
      - Implicit
- This member is added by an implicit conversion from UnicastMessage to StringFormat[UnicastMessage] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        getClass(): Class[_]
      
      
      - Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        hashCode(): Int
      
      
      - Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
 
- 
      
      
      
        
      
    
      
        
        val
      
      
        id: MessageID
      
      
      The identifier of the message. The identifier of the message. - returns
- the identifier of the message 
 - Definition Classes
- UnicastMessage → Message → Event
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        isInstanceOf[T0]: Boolean
      
      
      - Definition Classes
- Any
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        ne(arg0: AnyRef): Boolean
      
      
      - Definition Classes
- AnyRef
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        notify(): Unit
      
      
      - Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        notifyAll(): Unit
      
      
      - Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        synchronized[T0](arg0: ⇒ T0): T0
      
      
      - Definition Classes
- AnyRef
 
-  lazy val toPrettyString: String
- 
      
      
      
        
      
    
      
        
        def
      
      
        toString(): String
      
      
      - Definition Classes
- AnyRef → Any
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(arg0: Long, arg1: Int): Unit
      
      
      - Definition Classes
- AnyRef
- Annotations
- @throws( ... )
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(arg0: Long): Unit
      
      
      - Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
 
- 
      
      
      
        
      
    
      
        final 
        def
      
      
        wait(): Unit
      
      
      - Definition Classes
- AnyRef
- Annotations
- @throws( ... )
 
- 
      
      
      
        
      
    
      
        
        def
      
      
        →[B](y: B): (UnicastMessage, B)
      
      
      - Implicit
- This member is added by an implicit conversion from UnicastMessage to ArrowAssoc[UnicastMessage] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc