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 remoting | |
import akka.actor.{Actor, ActorLogging, ActorSystem, Props} | |
import com.typesafe.config.ConfigFactory | |
import scala.io.StdIn | |
/** | |
* Created by johan on 2016-08-03. | |
*/ |
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.http.scaladsl.Http | |
import akka.http.scaladsl.marshalling._ | |
import akka.http.scaladsl.server.Directives._ | |
import akka.stream.ActorMaterializer | |
import http.ActorPerRequest.RequestHandler.Handle | |
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
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 { |
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._ | |
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
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.*; | |
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, 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
package basics | |
import akka.actor.{ActorSystem, ExtendedActorSystem} | |
import akka.serialization.{JavaSerializer, SerializationExtension} | |
import com.typesafe.config.ConfigFactory | |
trait MyPayload | |
trait OtherPayload | |
trait PersistentExecutorProtocol extends Serializable { |
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.typed.Behavior | |
import akka.typed.scaladsl.Actor._ | |
sealed trait LifecycleCommand | |
object Stop extends LifecycleCommand | |
val lifecycleBehavior: Behavior[LifecycleCommand] = | |
immutable[LifecycleCommand]((ctx, msg) => | |
msg match { | |
case Stop => |