v
This commit is contained in:
parent
adf1cc6ff2
commit
932143d2dd
@ -1,119 +1,166 @@
|
|||||||
@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 run
|
activate rundr
|
||||||
run->ee ** :create evnetEngine object
|
loop
|
||||||
activate ee
|
rundr->rundr: 检查是否处于时间段
|
||||||
ee->ee ++ : init()
|
rundr->rundr: 监控子进程是否存在
|
||||||
ee->eeq ** : Create Queue
|
rundr->run ** : create process
|
||||||
ee->eet ** : Create Child Thread
|
activate run
|
||||||
return
|
rundr->rundr: sleep(5)
|
||||||
return object
|
end loop
|
||||||
|
deactivate rundr
|
||||||
|
|
||||||
|
run->runle ** : create runle
|
||||||
|||
|
|||
|
||||||
|||
|
|||
|
||||||
run->me ** : new mainEngine(ee)
|
run->ee ** :create evnetEngine object
|
||||||
activate me
|
activate ee
|
||||||
me->me ++ : init()
|
ee->ee ++ : init()
|
||||||
me->ee ++ : ee.start()
|
ee->eeq ** : Create Queue
|
||||||
note right: 启动ee的子线程
|
ee->eet ** : Create event process thread
|
||||||
ee->eet ++ #red : thread.start()
|
note right: 事件处理子线程
|
||||||
ee-->me--: return
|
ee->eetm ** : Create timer thread
|
||||||
me->dt ** :创建DataEngine()
|
note right: 定时器子线程
|
||||||
activate dt
|
|
||||||
dt->dt ++ : init()
|
|
||||||
return
|
|
||||||
return object
|
|
||||||
me->le ** :创建LogEngine()
|
|
||||||
activate le
|
|
||||||
le->le ++ : init()
|
|
||||||
return
|
|
||||||
return
|
|
||||||
me-->me--:return
|
|
||||||
me-->run--:return object
|
|
||||||
|||
|
|
||||||
|||
|
|
||||||
run->me: addGateway(ibGateway)
|
|
||||||
activate me
|
|
||||||
return
|
return
|
||||||
|
return object
|
||||||
|||
|
|||
|
||||||
|||
|
|||
|
||||||
run->me: addApp()
|
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
|
||||||
|
dt->dt ++ : init()
|
||||||
|
return
|
||||||
|
return object
|
||||||
|
me->le ** :创建LogEngine()
|
||||||
|
activate le
|
||||||
|
le->le ++ : init()
|
||||||
|
return
|
||||||
|
return
|
||||||
|
me-->me--:return
|
||||||
|
me-->run--: object
|
||||||
|
|||
|
||||||
|
|||
|
||||||
|
run->me: addGateway(ibGateway)
|
||||||
activate me
|
activate me
|
||||||
return
|
return
|
||||||
|||
|
|||
|
||||||
|||
|
|||
|
||||||
run->ee: ee.regiser() 注册日志处理事件
|
run->me: addApp()
|
||||||
|
activate me
|
||||||
|
return
|
||||||
|
|||
|
||||||
|
|||
|
||||||
|
run->ee: ee.regiser() 注册日志处理事件
|
||||||
activate ee
|
activate ee
|
||||||
return
|
return
|
||||||
|||
|
|||
|
||||||
|||
|
|||
|
||||||
run->me++: me.Connect(IB)
|
run->me++: me.Connect(IB)
|
||||||
note right: 连接IB网关
|
note right: 连接IB网关
|
||||||
me->dr**: new DrEngine(me,ee)
|
me->dr**: new DrEngine(me,ee)
|
||||||
activate dr
|
activate dr
|
||||||
dr->dr++:init()
|
dr->dr++:init()
|
||||||
dr->drq **:Create Queue
|
dr->drq **:Create Queue
|
||||||
dr->drt **:Create Thread
|
dr->drt **:Create Thread
|
||||||
activate drt #blue
|
activate drt #blue
|
||||||
dr->dr:loadSetting()
|
dr->dr:loadSetting()
|
||||||
note right
|
note right
|
||||||
从配置文件中加载
|
从配置文件中加载
|
||||||
订阅设置到字典对象
|
订阅设置到字典对象
|
||||||
end note
|
end note
|
||||||
dr->ee++:register(TICK, handler)
|
dr->ee++:register(TICK, handler)
|
||||||
return
|
return
|
||||||
dr-->dr -- : return
|
dr-->dr -- : return
|
||||||
'return object
|
'return object
|
||||||
dr-->me--: object
|
dr-->me--: object
|
||||||
run<--me--:return
|
run<--me--:return
|
||||||
|
|
||||||
|||
|
|||
|
||||||
|||
|
|||
|
||||||
eet->ee--: ee.run()
|
run->ee ++ : ee.register(EVENT_LOG, le.processLogEvent)
|
||||||
activate ee #red
|
return
|
||||||
loop
|
|
||||||
ee->eeq:queue.get()
|
|
||||||
gw->eeq ++: queue.put(tick/bar)
|
|
||||||
return
|
|
||||||
eeq-->ee: event
|
|
||||||
ee->ee ++ : __process(event)
|
|
||||||
ee->dr ++ #red :call procecssTickEvent()
|
|
||||||
dr->dr ++ :OnTick()
|
|
||||||
dr->drq ++: queue.put(tick)
|
|
||||||
return
|
|
||||||
return
|
|
||||||
|
|
||||||
dr->dr ++ :OnBar()
|
|||
|
||||||
dr->drq ++: queue.put(bar)
|
|||
|
||||||
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()
|
||||||
|
return event
|
||||||
|
ee->ee ++ : __process(event)
|
||||||
|
ee->dr ++ #red :call procecssTickEvent()
|
||||||
|
dr->dr ++ :OnTick()
|
||||||
|
dr->drq ++: queue.put(tick)
|
||||||
|
return
|
||||||
|
return
|
||||||
|
|
||||||
|
dr->dr ++ :OnBar()
|
||||||
|
dr->drq ++: queue.put(bar)
|
||||||
return
|
return
|
||||||
return
|
return
|
||||||
return
|
return
|
||||||
end loop
|
return
|
||||||
deactivate ee
|
end loop
|
||||||
|
deactivate ee
|
||||||
|
|
||||||
|
|
||||||
drt->dr -- :run()
|
drt->dr -- :run()
|
||||||
activate dr #blue
|
activate dr #blue
|
||||||
loop
|
loop
|
||||||
dr->drq ++ :queue.get()
|
dr->drq ++ :queue.get()
|
||||||
drq-->dr --:data
|
drq-->dr --:data
|
||||||
dr->me:insertDB(data)
|
dr->me:insertDB(data)
|
||||||
end loop
|
end loop
|
||||||
deactivate dr
|
deactivate dr
|
||||||
|
|
||||||
me->db: 写入mongoDB
|
me->db: 写入mongoDB
|
||||||
|
|
||||||
@enduml
|
@enduml
|
||||||
|
Loading…
Reference in New Issue
Block a user