XF

# Services ## Reactive ``` plantuml @startuml participant MainLand as main participant Queue as queue participant Behavior as behavior participant XF as xf main -> behavior: push(event) behavior -> queue: add(event) xf -> xf: dispatchEvent() activate xf xf -> queue : getEvent() queue --> xf xf -> behavior: processEvent() deactivate xf @enduml ``` ## Timeout ``` plantuml @startuml participant TimerQueue as tq #cyan participant Timeout as t #LawnGreen participant TimeoutManager as tm #cyan participant EventQueue as eq #cyan participant MainLand as main #cyan participant Reactive as r #yellow r ->> tm: scheduleTimeout(tmid, evid, duration) activate r #magenta deactivate r create t tm -->> t: <> tm ->> tq: add(tm) <> tm ->> tq: tick() tq ->> t: decrement() tm ->> tq: tick() tq ->> t: decrement() tm ->> eq: pushEvent(tm) <> tm ->> tq: remove(id) <> main ->> eq: popEvent() <> activate main #yellow eq -->> main: ev main ->> t: getTarget() t -->> main: reactive main ->> r: processEvent(ev) activate r #magenta r -->> main deactivate r main -->> t !!: <> @enduml ``` ## Protection - Mutex, sémaphore - éviter les conflits mémoire