mirror of
https://github.com/corda/corda.git
synced 2024-12-28 16:58:55 +00:00
Only emit SM Add events when the flow signals that it started
This commit is contained in:
parent
81801d4566
commit
7a9ce48996
@ -265,6 +265,9 @@ class MultiThreadedStateMachineManager(
|
|||||||
override fun signalFlowHasStarted(flowId: StateMachineRunId) {
|
override fun signalFlowHasStarted(flowId: StateMachineRunId) {
|
||||||
concurrentBox.concurrent {
|
concurrentBox.concurrent {
|
||||||
startedFutures.remove(flowId)?.set(Unit)
|
startedFutures.remove(flowId)?.set(Unit)
|
||||||
|
flows[flowId]?.let { flow ->
|
||||||
|
changesPublisher.onNext(StateMachineManager.Change.Add(flow.fiber.logic))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,7 +574,6 @@ class MultiThreadedStateMachineManager(
|
|||||||
Fiber.unparkDeserialized(flow.fiber, scheduler)
|
Fiber.unparkDeserialized(flow.fiber, scheduler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
changesPublisher.onNext(StateMachineManager.Change.Add(flow.fiber.logic))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,6 +264,9 @@ class SingleThreadedStateMachineManager(
|
|||||||
override fun signalFlowHasStarted(flowId: StateMachineRunId) {
|
override fun signalFlowHasStarted(flowId: StateMachineRunId) {
|
||||||
mutex.locked {
|
mutex.locked {
|
||||||
startedFutures.remove(flowId)?.set(Unit)
|
startedFutures.remove(flowId)?.set(Unit)
|
||||||
|
flows[flowId]?.let { flow ->
|
||||||
|
changesPublisher.onNext(StateMachineManager.Change.Add(flow.fiber.logic))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -574,7 +577,6 @@ class SingleThreadedStateMachineManager(
|
|||||||
Fiber.unparkDeserialized(flow.fiber, scheduler)
|
Fiber.unparkDeserialized(flow.fiber, scheduler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
changesPublisher.onNext(StateMachineManager.Change.Add(flow.fiber.logic))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user