This commit is contained in:
zhu4ling3 2018-04-09 04:44:04 -04:00
parent adf1cc6ff2
commit 932143d2dd

View File

@ -1,24 +1,42 @@
@startuml @startuml
database mongoDB as db database mongoDB as db
participant runDataRecord as run participant runDataRecord as rundr
participant Process as run
participant MainEngine as me participant MainEngine as me
participant LogEngine as runle
participant DataEngine as dt participant DataEngine as dt
participant LogEngine as le participant LogEngine as le
participant DrEngine as dr participant DrEngine as dr
participant Queue as drq participant Queue as drq
participant Thread as drt participant Thread as drt
participant eventEngine as ee participant eventEngine as ee
participant Thread as eet participant EventProcessThread as eet
participant Queue as eeq participant Queue as eeq
participant TimerThread as eetm
participant ibGateway as gw participant ibGateway as gw
activate rundr
loop
rundr->rundr: 检查是否处于时间段
rundr->rundr: 监控子进程是否存在
rundr->run ** : create process
activate run activate run
rundr->rundr: sleep(5)
end loop
deactivate rundr
run->runle ** : create runle
|||
|||
run->ee ** :create evnetEngine object run->ee ** :create evnetEngine object
activate ee activate ee
ee->ee ++ : init() ee->ee ++ : init()
ee->eeq ** : Create Queue ee->eeq ** : Create Queue
ee->eet ** : Create Child Thread ee->eet ** : Create event process thread
note right: 事件处理子线程
ee->eetm ** : Create timer thread
note right: 定时器子线程
return return
return object return object
||| |||
@ -29,6 +47,7 @@ activate run
me->ee ++ : ee.start() me->ee ++ : ee.start()
note right: 启动ee的子线程 note right: 启动ee的子线程
ee->eet ++ #red : thread.start() ee->eet ++ #red : thread.start()
ee->eetm ++ #green : timer.start()
ee-->me--: return ee-->me--: return
me->dt ** :创建DataEngine() me->dt ** :创建DataEngine()
activate dt activate dt
@ -41,7 +60,7 @@ activate run
return return
return return
me-->me--:return me-->me--:return
me-->run--:return object me-->run--: object
||| |||
||| |||
run->me: addGateway(ibGateway) run->me: addGateway(ibGateway)
@ -81,13 +100,41 @@ activate run
||| |||
||| |||
run->ee ++ : ee.register(EVENT_LOG, le.processLogEvent)
return
|||
|||
run->ee ++ : ee.register(EVENT_ERROR, le.processErrorEvent)
return
|||
|||
loop
run->run: sleep(1)
end loop
deactivate run
|||
|||
gw->eeq ++: queue.put(tick/bar)
return
|||
|||
eetm->ee -- : ee.__runTimer()
activate ee #green
loop
ee->eeq ++ : queue.put(定时器事件)
return
ee->ee : 休眠1秒
end loop
deactivate ee
|||
|||
eet->ee--: ee.run() eet->ee--: ee.run()
activate ee #red activate ee #red
loop loop
ee->eeq:queue.get() ee->eeq ++ :queue.get()
gw->eeq ++: queue.put(tick/bar) return event
return
eeq-->ee: event
ee->ee ++ : __process(event) ee->ee ++ : __process(event)
ee->dr ++ #red :call procecssTickEvent() ee->dr ++ #red :call procecssTickEvent()
dr->dr ++ :OnTick() dr->dr ++ :OnTick()