doc: stylish dispatchers.md, #24717 (#27748)

This commit is contained in:
Patrik Nordwall 2019-09-19 16:32:37 +02:00 committed by GitHub
parent 3b3ce85b22
commit 4e705f1d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 32 deletions

View file

@ -4,6 +4,7 @@
package jdocs.actor.typed;
// #blocking-in-actor
import akka.actor.typed.*;
import akka.actor.typed.javadsl.*;
@ -31,3 +32,4 @@ public class BlockingActor extends AbstractBehavior<Integer> {
.build();
}
}
// #blocking-in-actor

View file

@ -10,6 +10,10 @@ import akka.actor.typed.javadsl.*;
// #print-actor
class PrintActor extends AbstractBehavior<Integer> {
public static Behavior<Integer> create() {
return Behaviors.setup(context -> new PrintActor());
}
@Override
public Receive<Integer> createReceive() {
return newReceiveBuilder()

View file

@ -12,7 +12,7 @@ import akka.actor.typed.javadsl.*;
// #separate-dispatcher
class SeparateDispatcherFutureActor extends AbstractBehavior<Integer> {
final Executor ec;
private final Executor ec;
public static Behavior<Integer> create() {
return Behaviors.setup(SeparateDispatcherFutureActor::new);
@ -38,7 +38,7 @@ class SeparateDispatcherFutureActor extends AbstractBehavior<Integer> {
.build();
}
private static final void triggerFutureBlockingOperation(Integer i, Executor ec) {
private static void triggerFutureBlockingOperation(Integer i, Executor ec) {
System.out.println("Calling blocking Future on separate dispatcher: " + i);
CompletableFuture<Integer> f =
CompletableFuture.supplyAsync(