* Add java.time.Duration support in the JavaDSL in akka-actor module #24646 * add deprecation and change retry
This commit is contained in:
parent
e18382bb0f
commit
6a9fa1946d
35 changed files with 419 additions and 80 deletions
|
|
@ -8,11 +8,10 @@ import akka.actor.*;
|
|||
import akka.japi.Procedure;
|
||||
import akka.pattern.BackoffSupervisor;
|
||||
import akka.persistence.*;
|
||||
import scala.concurrent.duration.Duration;
|
||||
import java.time.Duration;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class LambdaPersistenceDocTest {
|
||||
|
||||
|
|
@ -122,8 +121,8 @@ public class LambdaPersistenceDocTest {
|
|||
final Props props = BackoffSupervisor.props(
|
||||
childProps,
|
||||
"myActor",
|
||||
Duration.create(3, TimeUnit.SECONDS),
|
||||
Duration.create(30, TimeUnit.SECONDS),
|
||||
Duration.ofSeconds(3),
|
||||
Duration.ofSeconds(30),
|
||||
0.2);
|
||||
getContext().actorOf(props, "mySupervisor");
|
||||
super.preStart();
|
||||
|
|
|
|||
|
|
@ -17,14 +17,13 @@ import akka.actor.Props;
|
|||
import akka.persistence.query.EventEnvelope;
|
||||
import akka.stream.actor.ActorPublisherMessage.Cancel;
|
||||
|
||||
import scala.concurrent.duration.FiniteDuration;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.time.Duration;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
|
|
@ -47,7 +46,7 @@ class MyEventsByTagJavaPublisher extends AbstractActorPublisher<EventEnvelope> {
|
|||
public MyEventsByTagJavaPublisher(Connection connection,
|
||||
String tag,
|
||||
Long offset,
|
||||
FiniteDuration refreshInterval) {
|
||||
Duration refreshInterval) {
|
||||
this.connection = connection;
|
||||
this.tag = tag;
|
||||
this.currentOffset = offset;
|
||||
|
|
@ -72,7 +71,7 @@ class MyEventsByTagJavaPublisher extends AbstractActorPublisher<EventEnvelope> {
|
|||
}
|
||||
|
||||
public static Props props(Connection conn, String tag, Long offset,
|
||||
FiniteDuration refreshInterval) {
|
||||
Duration refreshInterval) {
|
||||
return Props.create(() ->
|
||||
new MyEventsByTagJavaPublisher(conn, tag, offset, refreshInterval));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue