官术网_书友最值得收藏!

Concurrency through Akka actors

Concurrency is achieved through utilization of the actor model using the Akka Scala library. Actors act as independent entities and can pass async messages to other actors. In this project, there are three actors: SchedulerActor, PredictionActor, and TraderActor:

  • SchedulerActor: Requests price data, stores them into DB, sends a message with prices to PredictionActor, receives an answer, and passes it to TraderActor.
  • PredictionActor: After receiving a message with prices, it predicts the next price using the best model available (this has to be chosen in application.conf; we will see the details later on). It passes a message with the prediction back to SchedulerActor, uses the rest of the modes from the model folder to make predictions on previous data, and uses the latest price to evaluate predictions. The results of such predictions are stored in the DB.
  • TraderActor: After receiving a message about prediction, using rules (which at this moment are as simple as buy if the price is predicted to grow and do nothing otherwise), this writes its decision into logs. It can send an HTTP request to a URL to trigger this decision.
主站蜘蛛池模板: 永定县| 崇义县| 沧源| 马边| 香港 | 安泽县| 灵山县| 汤阴县| 新邵县| 南安市| 元氏县| 英吉沙县| 普格县| 虞城县| 新昌县| 卢龙县| 阿坝县| 金湖县| 北安市| 家居| 大邑县| 临西县| 恩平市| 宁蒗| 常熟市| 黎川县| 溆浦县| 莫力| 黑龙江省| 太仓市| 肇东市| 同江市| 和政县| 沁水县| 锡林郭勒盟| 孟津县| 铜山县| 石景山区| 克东县| 辽阳市| 积石山|