Skip to content
Snippets Groups Projects
7_actionupdatequeue.tex 821 B
Newer Older
Michael Kmoch's avatar
Michael Kmoch committed
\section{ActionUpdateQueue}
The ActionUpdateQueue event will be invoked each second on the server
and remove all outdated request. If a request is deleted, all clients
will be informed to abort this transaction.
\\
\begin{lstlisting}
protected void onAction(ActorRef sender, ActorRef self, UntypedActorContext context,
                        SuperVisor superVisor) {
  List<DistributedCommitedTransferRequest> deletes = superVisor.updateList();
  for(DistributedCommitedTransferRequest outdatedRequest : deletes){
    ActionCommitDistributedCommitedTransfer acdct =
      new ActionCommitDistributedCommitedTransfer(outdatedRequest);
    for(ActorRef neighbor : superVisor.getKnownNeighbors().values()){
      neighbor.tell(acdct, self);
    }
  }
  sleep(self,context,1000);
  self.tell(this, self);
}
\end{lstlisting}