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

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.
主站蜘蛛池模板: 凤台县| 报价| 论坛| 裕民县| 安溪县| 图木舒克市| 抚宁县| 建德市| 临高县| 军事| 花垣县| 景宁| 洞头县| 湘潭县| 桃源县| 大埔县| 峨眉山市| 玉田县| 定襄县| 三明市| 常山县| 新余市| 金门县| 兴安盟| 曲周县| 泸水县| 资兴市| 宁国市| 海安县| 伊吾县| 永康市| 井陉县| 怀仁县| 读书| 水城县| 太湖县| 甘德县| 汉寿县| 兴隆县| 江口县| 通渭县|