This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.pekko.actor.{Actor, Timers, Props} | |
| import scala.concurrent.duration.* | |
| object RetryActor { | |
| case object DoWork | |
| case class RetryWork(attempt: Int) | |
| case object WorkSucceeded | |
| case object WorkFailed | |
| private case object RetryTimerKey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type CacheEntry<T> = { | |
| value: T, | |
| timeout: ReturnType<typeof setTimeout>, | |
| } | |
| class ExpiringCache<T> { | |
| private readonly cache: Record<string, CacheEntry<T>>; | |
| private readonly expirationTime: number; | |
| constructor(expirationTime: number = 5000) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package actors | |
| import actors.CpcActuator.Actor.{ FetchMeasurementKey, TimeoutKey, Work } | |
| import akka.actor.typed.scaladsl.{ ActorContext, Behaviors, StashBuffer, TimerScheduler } | |
| import akka.actor.typed.{ ActorRef, Behavior, SupervisorStrategy } | |
| import akka.util.Timeout | |
| import com.google.inject.Provides | |
| import play.api.Configuration | |
| import play.api.libs.concurrent.ActorModule | |
| import usecase.SamplePublisherService |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package actors | |
| import akka.actor.typed.scaladsl.Behaviors | |
| import akka.actor.typed.{ActorRef, Behavior} | |
| import scala.collection.immutable | |
| import scala.concurrent.duration.FiniteDuration | |
| import scala.reflect.ClassTag | |
| //see https://github.com/akka/akka/blob/v2.7.0/akka-actor-typed-tests/src/test/scala/docs/akka/typed/Aggregator.scala |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package example | |
| import akka.Done | |
| import akka.actor.typed.scaladsl.{ | |
| ActorContext, | |
| Behaviors, | |
| StashBuffer, | |
| TimerScheduler | |
| } | |
| import akka.actor.typed.{ActorRef, Behavior, SupervisorStrategy} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import typings.express.mod as express | |
| import typings.express.mod.{RequestHandler, request_=} | |
| import typings.expressServeStaticCore.mod.* | |
| import typings.node.bufferMod.global.Buffer | |
| import typings.node.processMod as process | |
| import wvlet.airframe.log | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.concurrent.duration.DurationInt | |
| import scala.concurrent.{ExecutionContext, Future} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package example | |
| import akka.actor.typed.ActorSystem | |
| import akka.actor.typed.scaladsl.AskPattern.{Askable, schedulerFromActorSystem} | |
| import akka.util.Timeout | |
| import com.typesafe.config.ConfigFactory | |
| import example.asyncHandler.{Req, Res} | |
| import org.scalablytyped.runtime.StringDictionary | |
| import typings.express.mod as express | |
| import typings.node.bufferMod.global.Buffer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package example | |
| import akka.Done | |
| import akka.actor.typed.scaladsl.{ActorContext, Behaviors, StashBuffer, TimerScheduler} | |
| import akka.actor.typed.{ActorRef, Behavior, SupervisorStrategy} | |
| import akka.pattern.StatusReply | |
| import org.scalablytyped.runtime.StringDictionary | |
| import typings.cheerio.cheerioMod.Cheerio | |
| import typings.cheerio.mod.Node | |
| import typings.devtoolsProtocol.mod.Protocol.Network.ResourceType |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package example | |
| import akka.actor.typed.scaladsl.{ActorContext, Behaviors, StashBuffer} | |
| import akka.actor.typed.{ActorRef, Behavior, SupervisorStrategy} | |
| import akka.pattern.StatusReply | |
| import akka.util.Timeout | |
| import typings.node.bufferMod.global.Buffer | |
| import typings.puppeteer.mod.Browser | |
| import java.util.UUID.randomUUID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1") | |
| addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta36") |
NewerOlder