v
This commit is contained in:
parent
adf1cc6ff2
commit
932143d2dd
@ -1,34 +1,53 @@
|
||||
@startuml
|
||||
database mongoDB as db
|
||||
participant runDataRecord as run
|
||||
participant runDataRecord as rundr
|
||||
participant Process as run
|
||||
participant MainEngine as me
|
||||
participant LogEngine as runle
|
||||
participant DataEngine as dt
|
||||
participant LogEngine as le
|
||||
participant DrEngine as dr
|
||||
participant Queue as drq
|
||||
participant Thread as drt
|
||||
participant eventEngine as ee
|
||||
participant Thread as eet
|
||||
participant EventProcessThread as eet
|
||||
participant Queue as eeq
|
||||
participant TimerThread as eetm
|
||||
participant ibGateway as gw
|
||||
|
||||
|
||||
activate run
|
||||
run->ee ** :create evnetEngine object
|
||||
activate rundr
|
||||
loop
|
||||
rundr->rundr: 检查是否处于时间段
|
||||
rundr->rundr: 监控子进程是否存在
|
||||
rundr->run ** : create process
|
||||
activate run
|
||||
rundr->rundr: sleep(5)
|
||||
end loop
|
||||
deactivate rundr
|
||||
|
||||
run->runle ** : create runle
|
||||
|||
|
||||
|||
|
||||
run->ee ** :create evnetEngine object
|
||||
activate ee
|
||||
ee->ee ++ : init()
|
||||
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 object
|
||||
|||
|
||||
|||
|
||||
run->me ** : new mainEngine(ee)
|
||||
run->me ** : new mainEngine(ee)
|
||||
activate me
|
||||
me->me ++ : init()
|
||||
me->ee ++ : ee.start()
|
||||
note right: 启动ee的子线程
|
||||
ee->eet ++ #red : thread.start()
|
||||
ee->eetm ++ #green : timer.start()
|
||||
ee-->me--: return
|
||||
me->dt ** :创建DataEngine()
|
||||
activate dt
|
||||
@ -41,25 +60,25 @@ activate run
|
||||
return
|
||||
return
|
||||
me-->me--:return
|
||||
me-->run--:return object
|
||||
me-->run--: object
|
||||
|||
|
||||
|||
|
||||
run->me: addGateway(ibGateway)
|
||||
run->me: addGateway(ibGateway)
|
||||
activate me
|
||||
return
|
||||
|||
|
||||
|||
|
||||
run->me: addApp()
|
||||
run->me: addApp()
|
||||
activate me
|
||||
return
|
||||
|||
|
||||
|||
|
||||
run->ee: ee.regiser() 注册日志处理事件
|
||||
run->ee: ee.regiser() 注册日志处理事件
|
||||
activate ee
|
||||
return
|
||||
|||
|
||||
|||
|
||||
run->me++: me.Connect(IB)
|
||||
run->me++: me.Connect(IB)
|
||||
note right: 连接IB网关
|
||||
me->dr**: new DrEngine(me,ee)
|
||||
activate dr
|
||||
@ -81,13 +100,41 @@ activate run
|
||||
|
||||
|||
|
||||
|||
|
||||
eet->ee--: ee.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()
|
||||
activate ee #red
|
||||
loop
|
||||
ee->eeq:queue.get()
|
||||
gw->eeq ++: queue.put(tick/bar)
|
||||
return
|
||||
eeq-->ee: event
|
||||
ee->eeq ++ :queue.get()
|
||||
return event
|
||||
ee->ee ++ : __process(event)
|
||||
ee->dr ++ #red :call procecssTickEvent()
|
||||
dr->dr ++ :OnTick()
|
||||
@ -105,7 +152,7 @@ activate run
|
||||
deactivate ee
|
||||
|
||||
|
||||
drt->dr -- :run()
|
||||
drt->dr -- :run()
|
||||
activate dr #blue
|
||||
loop
|
||||
dr->drq ++ :queue.get()
|
||||
@ -114,6 +161,6 @@ activate run
|
||||
end loop
|
||||
deactivate dr
|
||||
|
||||
me->db: 写入mongoDB
|
||||
me->db: 写入mongoDB
|
||||
|
||||
@enduml
|
||||
|
Loading…
Reference in New Issue
Block a user