Skip to content

Commit

Permalink
add compile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Roiocam committed Sep 3, 2024
1 parent 980333f commit 6b4310b
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ public Behavior<MyMsg> aroundSignal(
});
}

{
Behavior<MyMsg> b =
Behaviors.withTimersSetup(
(timers, ctx) -> {
timers.startSingleTimer("key", new MyMsgB("tick"), Duration.ofSeconds(1));
ctx.scheduleOnce(Duration.ofSeconds(1), ctx.getSelf(), new MyMsgB("tick"));
return Behaviors.ignore();
});
}

static class MyBehavior extends ExtensibleBehavior<MyMsg> {

@Override
Expand Down Expand Up @@ -233,4 +243,20 @@ public Behavior<MyMsg> receive(TypedActorContext<MyMsg> context, MyMsg message)
return Behaviors.empty();
});
}
// stash buffer with setup
{
Behavior<String> behavior =
Behaviors.withStashSetup(
5,
(stash, ctx) -> {
stash.forEach(
msg -> {
// checked is ok
throw new Exception("checked");
});

ctx.scheduleOnce(Duration.ofSeconds(1), ctx.getSelf(), "tick");
return Behaviors.empty();
});
}
}

0 comments on commit 6b4310b

Please sign in to comment.