This file contains 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 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 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 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 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 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 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 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 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") |
This file contains 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
lazy val root = (project in file(".")) | |
.enablePlugins(ScalablyTypedConverterPlugin) | |
.configure(baseSettings, bundlerSettings, nodeProject) | |
.settings( | |
useYarn := true, | |
name := "squid-game", | |
scalaJSUseMainModuleInitializer := true, | |
libraryDependencies += ("org.akka-js" %%% "akkajsactortyped" % "2.2.6.14").cross(CrossVersion.for3Use2_13), | |
libraryDependencies += ("org.akka-js" %%% "akkajstypedtestkit" % "2.2.6.14" % "test").cross(CrossVersion.for3Use2_13), | |
libraryDependencies += ("org.akka-js" %%% "akkajsactorstreamtyped" % "2.2.6.14").cross(CrossVersion.for3Use2_13), |
NewerOlder