add timeout sequence diagram
This commit is contained in:
BIN
UML/timeout.png
Normal file
BIN
UML/timeout.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
62
UML/timeout.puml
Normal file
62
UML/timeout.puml
Normal file
@ -0,0 +1,62 @@
|
||||
@startuml
|
||||
|
||||
participant "Behavior::StateMachine" as sm
|
||||
participant Dispatcher as d
|
||||
participant TimeoutManager as tm
|
||||
entity "Event::Timeout" as t
|
||||
queue "TimeoutManager::timeouts_" as timeouts
|
||||
|
||||
autoactivate off
|
||||
|||
|
||||
|||
|
||||
== Schedule timeout ==
|
||||
|||
|
||||
sm -> sm++ : scheduleTimeout
|
||||
sm -> d ++: getDispatcher
|
||||
d --> sm --: dispatcher
|
||||
sm -> d --++ : scheduleTimeout
|
||||
d -> tm ++: getTimeoutManager
|
||||
tm --> d --: timeoutManager
|
||||
d -> tm --++ : scheduleTimeout
|
||||
tm -> t ** : new
|
||||
t --> tm
|
||||
tm -> timeouts --++: insert
|
||||
|
||||
|||
|
||||
|||
|
||||
== Decrement timeout (and dispatch) ==
|
||||
|||
|
||||
loop every tickInterval
|
||||
?->> tm ++: tick
|
||||
tm -> timeouts : getFront
|
||||
timeouts -> t ++
|
||||
t --> timeouts
|
||||
timeouts --> tm : timeout
|
||||
tm -> t --: decrement
|
||||
end
|
||||
|||
|
||||
note left t
|
||||
When timeout is 0,
|
||||
dispatch event
|
||||
end note
|
||||
t -> timeouts : pop
|
||||
deactivate timeouts
|
||||
t ->? --: pushEvent
|
||||
|
||||
|||
|
||||
|||
|
||||
== Unschedule timeout ==
|
||||
|||
|
||||
sm -> sm++ : unscheduleTimeout
|
||||
sm -> d ++: getDispatcher
|
||||
d --> sm --: dispatcher
|
||||
sm -> d --++ : unscheduleTimeout
|
||||
d -> tm ++: getTimeoutManager
|
||||
tm --> d --: timeoutManager
|
||||
d -> tm --++ : unscheduleTimeout
|
||||
tm -> timeouts --: erase
|
||||
timeouts -> t !!
|
||||
|
||||
|
||||
|
||||
@enduml
|
Reference in New Issue
Block a user