AioTrade Investigation (Section A: DataServer)
guibin.beijing@gmail.com
AioTrade source code:
https://github.com/dcaoyuan/aiotrade
Note: The DataServer we are talking about is just org.aiotrade.lib.math.timeseries.DataServer, and the source code can be found at
https://github.com/dcaoyuan/aiotrade/tree/master/libs/lib.math/src/main/scala/org/aiotrade/lib/math/timeseries/datasource/DataServer.scala
DataServer's responsibility is to load the quote data from some data source, and do the processing logic via processData. The old version DataServer could save the data in its storage quotes, but now it doesn't.
This DataServer also records the contract who subscribe this DataServer, and records the symbol to contract mapping. One DataServer could act as the data source for several uniSymbols. According to the design, each security could have its own data server, different security could have different data server.
1. object DataServer
This
object DataServer just publish the heart beat to drive the workflow in class DataServer. The heart beat is implemented by the simple timer.
2. Workflow of class DataServer
e: event; a: action.
e:
HeartBeat(interval) -> e:
AskLoadData(loadedTime, subscribedContracts) -> a:
requestData(afterTime, contracts) -> e:
DataLoaded(values: Array[V], contract) -> a:
processData(values, contract.asInstanceOf[C]) -> e:
DataProcessed
3. Explanation for the workflow
The object DataServer fires the heart beat periodically, class DataServer should listen to this object DataServer. When receives the heart beat, class DataServer will judge whether it should react to this. If it is refreshable and is not loading data at that moment, it will react to publish the AskLoadData event to drive the requestData action.
In the requestData action, class DataServer should request the data from the itself's data source, such as database, dbf, yahoo's web service etc.
When finishes requesting data, it should publish the event DataLoaded to drive the processData. The logic in the processData can be merging the tickers into time serieses.
After processing data, class DataServer will publish the event DataProcessed to notify its finishing processing data.
4. Other functions in class DataServer
Class DataServer has a method named
protected def publishData(msg: Any), by default, it will publish msg to local reactor. If necessary, we can override this function to publish the msg to remote reactor via AMQP etc.
The methods startRefresh and stopRefresh can be use to enable or disable the heart beat to let the workflow work or not.
分享到:
相关推荐
电泳沉积法制备SnO2:Ti 复合纳米线阵列及其气敏性质研究,李建军,朱金波,通过电泳沉积法与阳极氧化铝模板相结合可控制备出高度有序的Sn0.96Ti0.04O复合纳米线阵列。系统的结构表征显示所得SnO2:Ti复合纳米线�
《Vision:A Computational Investigation into the Human Representation and Processing of Visual Information》,计算机视觉奠基之作
comparative investigation between a single ended and a balanced IF VGA
An Investigation in Implementing a C++ Voxel Game Engine with Destructible Terrain In video games today, world geometry is often represented as a polygon mesh. While this representation is able to ...
Investigation of Layered Bismuthates: (Ba, K)3Bi2O7 and (Ba, K)2BiO4 Schichtförmige Manganate Poster Investigation of Layered Bismuthates: (Ba,K)3Bi2O7 and (Ba,K)2BiO4 N. R. Khasanovaa, M. L. ...
Symptoms and Causes of a Server Core Dump Identifying Why Core File is Not Produced Investigating Causes of Server Core Dump Overview of Investigation Overview of Core File Tools Overview of Standard ...
对CSK(code shift keying)调制进行了详细的介绍,讲述了其基本原理,对调制解调方法,捕获跟踪等性能进行了分析,给出了推荐参数设计,通过对仿真和实测数据进行对比分析验证了各方面性能。
llc设计经典文章,建议反复读
opti-scan+Investigation+7.4.3.0+-+Internal+until+2018.10.01
TEMS 14.2更新说明 TEMS Investigation 14.2 Release Note
Numerical Investigation of the Interaction of Counterflowing Jets and Supersonic Capsule Flows
完整英文版UL 2703A:2022 Outline of Investigation for Flashing Devices and Systems for Rooftop-Mounted Photovoltaics - (屋顶光伏发电的闪光装置和系统调查大纲)。这些要求涵盖了在光伏支架安装系统穿透...
完整英文版 UL 2703A:2022 Outline of Investigation for Flashing Devices and Systems for Rooftop-Mounted Photovoltaics(屋顶光伏发电闪光装置和系统研究概要)。 这些要求涵盖了在光伏支架安装系统穿透屋顶...
Title: An Investigation of the Laws of Thought Author: George Boole Release Date: July 19, 2017
Primary: studies based on primary, or original, data sources, such as classroom observations or real students, or their test scores, or their responses to a questionnaire. Secondary: studies based on ...
详细的介绍了TEMS INVESTIGATION的最新功能
<a id='intro'></a> ## Introduction > We're going to investigate this dataset on physicochemical properties and quality ratings of red and white wine samples. > ### Data Set Information: > The two ...
一篇论文,关于大幅面干涉测量,真的有效实用,为需要的人提供。
TEMS_Investigation__7.1中文说明书
TEMS Investigation GSM 5.0 是前台路测软件,Deskcat 5.5 是后台分析软件。因为软件版本较新,无法使用万禾的数据转换功能转换到万禾的后台分析。 TEMS Investigation GSM 5.0 加密狗集成在测试手机里面,无须另外...