From 7dba345b554c370d5f7fb8ed45c0ca4ed12f2df2 Mon Sep 17 00:00:00 2001 From: Akara Sucharitakul Date: Wed, 9 Mar 2022 17:53:54 -0800 Subject: [PATCH] #752 Catch stashed lifecycle event from `starting` if not used (#753) * Invoke Github Actions * #750: Fixed future handling in said test. * #752: Fixed extra dead letter on PerpetualStream startup. --- .github/workflows/publish.yml | 2 +- .../main/scala/org/squbs/stream/PerpetualStreamBase.scala | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a816dcd6..e2ab4708 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Pull Request +name: Build 'on': push: branches: diff --git a/squbs-unicomplex/src/main/scala/org/squbs/stream/PerpetualStreamBase.scala b/squbs-unicomplex/src/main/scala/org/squbs/stream/PerpetualStreamBase.scala index d047ee85..decf9df1 100644 --- a/squbs-unicomplex/src/main/scala/org/squbs/stream/PerpetualStreamBase.scala +++ b/squbs-unicomplex/src/main/scala/org/squbs/stream/PerpetualStreamBase.scala @@ -70,7 +70,7 @@ trait PerpetualStreamBase[T] extends Actor with ActorLogging with Stash with Gra final def starting: Receive = { case `streamRunLifecycleState` => - context.become(running orElse flowMatValue orElse receive) + context.become(running orElse flowMatValue orElse receive orElse catchAnyLifecycleState) matValueOption = Option(runGraph()) unstashAll() case _ => stash() @@ -96,6 +96,10 @@ trait PerpetualStreamBase[T] extends Actor with ActorLogging with Stash with Gra final def flowMatValue: Receive = { case MatValueRequest => sender() ! matValue } + + final def catchAnyLifecycleState: Receive = { + case _: LifecycleState => // Stashed lifecycle states without meaning or anyone caring should be ignored. + } } case object MatValueRequest {