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

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.
主站蜘蛛池模板: 噶尔县| 中山市| 望城县| 高台县| 沙雅县| 石狮市| 隆尧县| 铁岭市| 平凉市| 临沂市| 上饶市| 鹤山市| 横山县| 那坡县| 万源市| 福泉市| 邢台县| 黄浦区| 灵宝市| 鄂尔多斯市| 蒲城县| 林周县| 泰宁县| 钟山县| 锡林郭勒盟| 和硕县| 昆山市| 宁阳县| 叙永县| 无锡市| 宿松县| 陈巴尔虎旗| 博爱县| 耒阳市| 枞阳县| 九龙城区| 华阴市| 遵义市| 新建县| 高邑县| 绥滨县|