Add missing 'Suspendable' annotations to suspending methods (#6480)

This commit is contained in:
Kyriakos Tharrouniatis 2020-07-20 15:09:26 +01:00 committed by GitHub
parent d4444e520a
commit 5fef0726a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -73,6 +73,7 @@ internal class ActionExecutorImpl(
if (action.uuid != null) services.vaultService.softLockRelease(action.uuid) if (action.uuid != null) services.vaultService.softLockRelease(action.uuid)
} }
@Suspendable
private fun executeTrackTransaction(fiber: FlowFiber, action: Action.TrackTransaction) { private fun executeTrackTransaction(fiber: FlowFiber, action: Action.TrackTransaction) {
actionFutureExecutor.awaitTransaction(fiber, action) actionFutureExecutor.awaitTransaction(fiber, action)
} }
@ -223,6 +224,7 @@ internal class ActionExecutorImpl(
} }
@Suppress("TooGenericExceptionCaught") @Suppress("TooGenericExceptionCaught")
@Suspendable
private fun executeAsyncOperation(fiber: FlowFiber, action: Action.ExecuteAsyncOperation) { private fun executeAsyncOperation(fiber: FlowFiber, action: Action.ExecuteAsyncOperation) {
try { try {
actionFutureExecutor.awaitAsyncOperation(fiber, action) actionFutureExecutor.awaitAsyncOperation(fiber, action)

View File

@ -1,5 +1,6 @@
package net.corda.node.services.statemachine package net.corda.node.services.statemachine
import co.paralleluniverse.fibers.Suspendable
import net.corda.core.internal.concurrent.thenMatch import net.corda.core.internal.concurrent.thenMatch
import net.corda.core.utilities.contextLogger import net.corda.core.utilities.contextLogger
import net.corda.core.utilities.debug import net.corda.core.utilities.debug
@ -45,6 +46,7 @@ internal class ActionFutureExecutor(
* @param fiber The [FlowFiber] to resume after completing the async operation * @param fiber The [FlowFiber] to resume after completing the async operation
* @param action The [Action.ExecuteAsyncOperation] to create a future from * @param action The [Action.ExecuteAsyncOperation] to create a future from
*/ */
@Suspendable
fun awaitAsyncOperation(fiber: FlowFiber, action: Action.ExecuteAsyncOperation) { fun awaitAsyncOperation(fiber: FlowFiber, action: Action.ExecuteAsyncOperation) {
cancelFutureIfRunning(fiber, action.currentState) cancelFutureIfRunning(fiber, action.currentState)
val instance = fiber.instanceId val instance = fiber.instanceId
@ -63,6 +65,7 @@ internal class ActionFutureExecutor(
* @param fiber The [FlowFiber] to resume after the committing the specified transaction * @param fiber The [FlowFiber] to resume after the committing the specified transaction
* @param action [Action.TrackTransaction] contains the transaction hash to wait for * @param action [Action.TrackTransaction] contains the transaction hash to wait for
*/ */
@Suspendable
fun awaitTransaction(fiber: FlowFiber, action: Action.TrackTransaction) { fun awaitTransaction(fiber: FlowFiber, action: Action.TrackTransaction) {
cancelFutureIfRunning(fiber, action.currentState) cancelFutureIfRunning(fiber, action.currentState)
val instance = fiber.instanceId val instance = fiber.instanceId