add akka-typed project with generic ActorRef
This is the first step towards more type-safety in Actor interactions,
comprising:
* generic ActorRef[T] that only accepts T messages
* generic ActorSystem[T] extends ActorRef[T] (sending to the guardian,
whose Props[T] are provided for ActorSystem construction)
* removed the Actor trait: everything in there has been made into
messages and signals
* new Behavior[T] abstraction that consumes messages (of type T) or
Signals (lifecycle hooks, Terminated, ReceiveTimeout, Failed),
producing the next Behavior[T] as the result each time
* the ask pattern is provided and yields properly typed Futures
* variants of ActorContext are provided for synchronous testing of
Behaviors
All of this is implemented without touching code outside akka-typed
(apart from making guardianProps configurable), creating wrapper objects
around ActorRef, ActorContext, ActorSystem, Props and providing an Actor
implementation that just runs a Behavior.
2015-01-28 20:45:21 +01:00
|
|
|
/**
|
2018-01-04 17:26:29 +00:00
|
|
|
* Copyright (C) 2014-2018 Lightbend Inc. <https://www.lightbend.com>
|
add akka-typed project with generic ActorRef
This is the first step towards more type-safety in Actor interactions,
comprising:
* generic ActorRef[T] that only accepts T messages
* generic ActorSystem[T] extends ActorRef[T] (sending to the guardian,
whose Props[T] are provided for ActorSystem construction)
* removed the Actor trait: everything in there has been made into
messages and signals
* new Behavior[T] abstraction that consumes messages (of type T) or
Signals (lifecycle hooks, Terminated, ReceiveTimeout, Failed),
producing the next Behavior[T] as the result each time
* the ask pattern is provided and yields properly typed Futures
* variants of ActorContext are provided for synchronous testing of
Behaviors
All of this is implemented without touching code outside akka-typed
(apart from making guardianProps configurable), creating wrapper objects
around ActorRef, ActorContext, ActorSystem, Props and providing an Actor
implementation that just runs a Behavior.
2015-01-28 20:45:21 +01:00
|
|
|
*/
|
2018-03-13 23:45:55 +09:00
|
|
|
|
add akka-typed project with generic ActorRef
This is the first step towards more type-safety in Actor interactions,
comprising:
* generic ActorRef[T] that only accepts T messages
* generic ActorSystem[T] extends ActorRef[T] (sending to the guardian,
whose Props[T] are provided for ActorSystem construction)
* removed the Actor trait: everything in there has been made into
messages and signals
* new Behavior[T] abstraction that consumes messages (of type T) or
Signals (lifecycle hooks, Terminated, ReceiveTimeout, Failed),
producing the next Behavior[T] as the result each time
* the ask pattern is provided and yields properly typed Futures
* variants of ActorContext are provided for synchronous testing of
Behaviors
All of this is implemented without touching code outside akka-typed
(apart from making guardianProps configurable), creating wrapper objects
around ActorRef, ActorContext, ActorSystem, Props and providing an Actor
implementation that just runs a Behavior.
2015-01-28 20:45:21 +01:00
|
|
|
package akka.util;
|
|
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* IMPORTANT: do not change this file, the line numbers are verified in LineNumberSpec
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public class LineNumberSpecCodeForJava {
|
|
|
|
|
|
2016-12-06 16:12:04 +01:00
|
|
|
public static interface F extends Serializable {
|
|
|
|
|
public String doit(String arg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public F f1() {
|
|
|
|
|
return (s) -> s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public F f2() {
|
|
|
|
|
return (s) -> {
|
|
|
|
|
System.out.println(s);
|
|
|
|
|
return s;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public F f3() {
|
|
|
|
|
return new F() {
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String doit(String arg) {
|
|
|
|
|
return arg;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
add akka-typed project with generic ActorRef
This is the first step towards more type-safety in Actor interactions,
comprising:
* generic ActorRef[T] that only accepts T messages
* generic ActorSystem[T] extends ActorRef[T] (sending to the guardian,
whose Props[T] are provided for ActorSystem construction)
* removed the Actor trait: everything in there has been made into
messages and signals
* new Behavior[T] abstraction that consumes messages (of type T) or
Signals (lifecycle hooks, Terminated, ReceiveTimeout, Failed),
producing the next Behavior[T] as the result each time
* the ask pattern is provided and yields properly typed Futures
* variants of ActorContext are provided for synchronous testing of
Behaviors
All of this is implemented without touching code outside akka-typed
(apart from making guardianProps configurable), creating wrapper objects
around ActorRef, ActorContext, ActorSystem, Props and providing an Actor
implementation that just runs a Behavior.
2015-01-28 20:45:21 +01:00
|
|
|
}
|