|
|
|
@ -154,10 +154,11 @@ func (node *Node) Allows(ctx *Context, principal_id NodeID, action Tree)(map[uui
|
|
|
|
|
return nil, Deny
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type WaitReason string
|
|
|
|
|
type WaitInfo struct {
|
|
|
|
|
Destination NodeID `gv:"destination"`
|
|
|
|
|
Timeout uuid.UUID `gv:"timeout"`
|
|
|
|
|
Reason string `gv:"reason"`
|
|
|
|
|
Reason WaitReason `gv:"reason"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type WaitMap map[uuid.UUID]WaitInfo
|
|
|
|
@ -176,7 +177,7 @@ func (node *Node) ProcessResponse(wait_map WaitMap, response ResponseSignal) (Wa
|
|
|
|
|
return WaitInfo{}, false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (node *Node) NewTimeout(reason string, dest NodeID, timeout time.Duration) (WaitInfo, uuid.UUID) {
|
|
|
|
|
func (node *Node) NewTimeout(reason WaitReason, dest NodeID, timeout time.Duration) (WaitInfo, uuid.UUID) {
|
|
|
|
|
id := uuid.New()
|
|
|
|
|
|
|
|
|
|
timeout_signal := NewTimeoutSignal(id)
|
|
|
|
@ -190,7 +191,7 @@ func (node *Node) NewTimeout(reason string, dest NodeID, timeout time.Duration)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Creates a timeout signal for signal, queues it for the node at the timeout, and returns the WaitInfo
|
|
|
|
|
func (node *Node) QueueTimeout(reason string, dest NodeID, signal Signal, timeout time.Duration) WaitInfo {
|
|
|
|
|
func (node *Node) QueueTimeout(reason WaitReason, dest NodeID, signal Signal, timeout time.Duration) WaitInfo {
|
|
|
|
|
timeout_signal := NewTimeoutSignal(signal.ID())
|
|
|
|
|
node.QueueSignal(time.Now().Add(timeout), timeout_signal)
|
|
|
|
|
|
|
|
|
|