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 akka.actor.{Actor, ActorSystem, Props, Stash} | |
class MyActor extends Actor with Stash { | |
def receive = { | |
case _ => | |
unstashAll() | |
println("after unstashAll") | |
} | |
} |
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 akka.actor.*; | |
public class FSMTestActor extends AbstractFSM<String, String> { | |
public final static String A = "A"; | |
static class Event { | |
public final int n; |
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 akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, Props} | |
import akka.cluster.{Cluster, MemberStatus} | |
import akka.routing.FromConfig | |
import com.typesafe.config.ConfigFactory | |
object ClusterRouting extends App { | |
class EchoActor extends Actor with ActorLogging { | |
log.info("Started") | |
def receive = { |
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 akka.actor.ActorRef; | |
import akka.actor.ActorSystem; | |
import akka.actor.Props; | |
import akka.actor.UntypedActor; | |
import akka.cluster.pubsub.DistributedPubSub; | |
import akka.cluster.pubsub.DistributedPubSubMediator; | |
import akka.event.Logging; | |
import akka.event.LoggingAdapter; | |
import com.typesafe.config.Config; |
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 streams | |
import akka.actor.ActorSystem | |
import akka.stream._ | |
import akka.stream.scaladsl._ | |
import com.typesafe.config.ConfigFactory | |
object StreamDispatchers extends App { | |
implicit val system = ActorSystem("dispatchers", ConfigFactory.parseString( |
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 akka.actor.ActorSystem | |
import akka.http.scaladsl.unmarshalling.Unmarshal | |
import akka.stream.ActorMaterializer | |
import scala.concurrent.Await | |
// important - it needs to be this Seq and not the default one | |
import scala.collection.immutable.Seq | |
// this is just for the await, so not really needed | |
import scala.concurrent.duration._ |
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 java.util.UUID | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.model.HttpRequest | |
import akka.http.scaladsl.model.headers.{ModeledCustomHeader, ModeledCustomHeaderCompanion} | |
import akka.stream.ActorMaterializer | |
import akka.http.scaladsl.server._ | |
import scala.io.StdIn |
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 streams; | |
import akka.stream.Attributes; | |
import akka.stream.Outlet; | |
import akka.stream.SourceShape; | |
import akka.stream.stage.AbstractOutHandler; | |
import akka.stream.stage.GraphStage; | |
import akka.stream.stage.GraphStageLogic; | |
import akka.stream.stage.OutHandler; |
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 streams; | |
import akka.actor.ActorSystem; | |
import akka.stream.ActorMaterializer; | |
import akka.stream.Materializer; | |
import akka.stream.contrib.FileTailSource; | |
import akka.stream.contrib.amqp.*; | |
import akka.stream.javadsl.Framing; | |
import akka.util.ByteString; | |
import scala.concurrent.duration.FiniteDuration; |
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 akka.actor.{Actor, ActorSystem, Props} | |
import akka.cluster.Cluster | |
import akka.cluster.ClusterEvent.{MemberEvent, ReachabilityEvent} | |
import com.typesafe.config.ConfigFactory | |
import scala.concurrent.Await | |
import scala.concurrent.duration._ | |
import scala.io.StdIn | |
object WeaklyUp extends App { |