-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegisterMessage.scala
More file actions
26 lines (20 loc) · 944 Bytes
/
RegisterMessage.scala
File metadata and controls
26 lines (20 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package org.protocols.register
import akka.actor.ActorRef
/**
* Register-based messages
*/
abstract sealed class RegisterMessage {
// Source of the message
def src: ActorRef
// An actor to send this message to
def dest: ActorRef
// Ballot, subject of interaction
def k: Int
}
final case class READ(src: ActorRef, dest: ActorRef, k: Int) extends RegisterMessage
final case class ackREAD(src: ActorRef, dest: ActorRef, k: Int, kWv: Option[(Int, Any)]) extends RegisterMessage
final case class nackREAD(src: ActorRef, dest: ActorRef, k: Int, kWv: Option[(Int, Any)]) extends RegisterMessage
final case class WRITE(src: ActorRef, dest: ActorRef, k: Int, vW: Any) extends RegisterMessage
final case class ackWRITE(src: ActorRef, dest: ActorRef, k: Int) extends RegisterMessage
final case class nackWRITE(src: ActorRef, dest: ActorRef, k: Int) extends RegisterMessage
case class MessageToProxy(rm: RegisterMessage, params: Any)