55 lines
726 B
Plaintext
55 lines
726 B
Plaintext
@startuml
|
|
|
|
participant Behavior as b
|
|
participant Dispatcher as d
|
|
entity Event as e
|
|
participant EventQueue as eq
|
|
queue "EventQueue::queue_" as q
|
|
|
|
== Create an Event ==
|
|
|||
|
|
?->> b ++ : GEN
|
|
b -> e ** : new
|
|
b -> b --++ : pushEvent
|
|
e -> b : getBehavior
|
|
b --> e ++: setBehavior
|
|
e --> b --
|
|
b -> d ++ : getDispatcher
|
|
d --> b
|
|
b -> d -- : pushEvent
|
|
d ->? -- : push
|
|
|
|
|
|
|||
|
|
|||
|
|
== Push Event ==
|
|
|||
|
|
?->> d ++: pushEvent
|
|
d -> eq--++: push
|
|
eq -> q ++
|
|
q --> eq
|
|
eq -> q -- : pushEndQueue
|
|
|
|
|||
|
|
|||
|
|
== Dispatch ==
|
|
|||
|
|
?->> d ++: executeOnce
|
|
d -> q : getFront
|
|
q -> e ++
|
|
e --> q
|
|
q --> d : event
|
|
d -> q : pop
|
|
deactivate q
|
|
d -> d --++ : dispatchEvent
|
|
d -> b ++ : getBehavior
|
|
b --> d
|
|
d -> b -- : process
|
|
b -> b--: processEvent
|
|
|
|
destroy e
|
|
|
|
|
|
|
|
|
|
@enduml |