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

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.
主站蜘蛛池模板: 泾阳县| 都昌县| 夏河县| 西吉县| 高青县| 巨野县| 长春市| 英超| 象州县| 象山县| 南华县| 花垣县| 溧阳市| 馆陶县| 墨竹工卡县| 宣威市| 昆山市| 远安县| 沧州市| 原平市| 云阳县| 邯郸县| 依安县| 特克斯县| 洞头县| 吉安市| 六枝特区| 清涧县| 西丰县| 莲花县| 珠海市| 姜堰市| 南丹县| 年辖:市辖区| 鹤庆县| 三穗县| 皮山县| 墨玉县| 巧家县| 方城县| 婺源县|