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复合纳米线阵列及其气敏性质研究》 本文由李建军、朱金波等学者共同发表,详细探讨了利用电泳沉积法制备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
《TEMS Investigation 7.1中文说明书》是一个关键的资源,它详细介绍了Telecommunications Engineer's Mobile System (TEMS) Investigation工具的7.1版本。TEMS Investigation是移动网络测试和分析的重要工具,广泛...
在本文档TEMS Investigation 14.2 Release Note中,我们主要关注TEMS Investigation 14.2版本的新功能和特性,同时也会详细介绍一些具体的操作步骤和应用场景。 首先,TEMS Investigation 14.2版本新增了对Sharp ...
文章“Investigation on Interference Test for Wells Connected by a Large Fracture”深入探讨了传统的干涉测试方法,并试图解决其在大型裂缝井之间测试连通性时缺乏实用分析模型的问题。 文章的主要内容包括: ...
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. ...
"Opti-scan Investigation 7.4.3.0" 是一款由欧佩泰斯(可能是指一家专注于光学扫描或检测技术的公司)开发的专业软件工具。这款软件主要用于光学扫描和调查,它提供了高级的图像处理和分析功能,旨在帮助用户在多个...
《TEMS Investigation 16 使用说明》文档详细介绍了如何安装和使用华为的TEMS Investigation 16软件,这是一款用于移动通信网络测试和分析的专业工具。文档特别强调了相较于旧版本15.3,16版修复了一系列重要的问题...
标题中的“Numerical Investigation”指的是数值模拟研究,这是一种在计算机上使用数学模型和算法来模拟物理现象的方法。在IT行业中,数值模拟广泛应用于解决复杂的工程问题,特别是在流体力学、热力学、电磁学等...
**TEMS Investigation测试软件说明书** **1. 前言** 在我们的项目部门新引入了TEMS Investigation测试软件,为了确保团队能够有效地使用这一高级工具,本说明书将详细介绍软件的安装、配置和基本操作。TEMS ...
本篇论文主要研究了在电信和计算机应用领域,如何实现高密度集成的AC-DC转换解决方案,以满足分布式电源系统(DPS)的需求。文章详细探讨了LLC谐振转换器的设计,以及如何通过提高功率密度来优化前端AC/DC转换器。...
### Syngree Press: Managing Catastrophic Loss of Sensitive Data — A Comprehensive Guide for IT and Security Professionals In today's digital landscape, the safeguarding of sensitive data has become ...
完整英文版 UL 2703A:2022 Outline of Investigation for Flashing Devices and Systems for Rooftop-Mounted Photovoltaics(屋顶光伏发电闪光装置和系统研究概要)。 这些要求涵盖了在光伏支架安装系统穿透屋顶...
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 ...
<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 ...
根据提供的文件信息,虽然标题、描述以及部分内容都未能提供有效的信息点,但我们可以尝试基于标题“Reducts within the variable precision rough sets model A further investigation”来构建相关的IT知识内容。...
这部分测试考生对英语口语材料的理解能力,分为两大部分:Section A(短对话)与Section B(长对话)。 #### 二、Section A 分析 **Section A**包含五段简短对话,每段对话只播放一次。每段对话后有20秒的暂停时间...