Interface StartedOp<D>
-
- Type Parameters:
D- The delegate type that is need for the implementing activity type
- All Superinterfaces:
CycleReadable,Payload<D>
- All Known Subinterfaces:
OpFacets<D>
- All Known Implementing Classes:
EventedOpImpl,OpImpl
public interface StartedOp<D> extends Payload<D>, CycleReadable
A StartedOp is a type that represents that an operation has been sent to some specific type of protocol or logic.Correctness
It is essential that developers close a StartedOp in one of the appropriate ways. Creating a StartedOp and not calling eithersucceed(int), orfail(int)will cause deadlocks in concurrency management. This is because the logic which tracks operations relies on these signals to know when to close out an operation and allow another to be started according to concurrency controls.retry()can be called as many times as an activity allows for, but this is not sufficient to retire the operation. After callingretry(), one of the end states above must be set.
-
-
Method Summary
Modifier and Type Method Description FailedOp<D>fail(int status)Mark this op as failed as of the time it is called, and record the resulting status code.longgetCurrentResponseTimeNanos()Return the nanos that have elapsed since this op was started at the time of this call, plus any prior waittime.longgetCurrentServiceTimeNanos()Return the nanos that have elapsed since the op was started at the time of this call.longgetStartedAtNanos()Get the nanosecond instant which was recorded for this operation to be started.StartedOp<D>retry()Reset the service timer on this op, and increment the tries counterSucceededOp<D>succeed(int status)Mark this op as successful as of the time it is called, and record the resulting status code.-
Methods inherited from interface io.engineblock.activityapi.cyclelog.buffers.results.CycleReadable
getCycle
-
-
-
-
Method Detail
-
retry
StartedOp<D> retry()
Reset the service timer on this op, and increment the tries counter- Returns:
- A StartedOp
-
succeed
SucceededOp<D> succeed(int status)
Mark this op as successful as of the time it is called, and record the resulting status code.- Parameters:
status- The status for this op, determined by individual activity types- Returns:
- a SucceededOp
-
fail
FailedOp<D> fail(int status)
Mark this op as failed as of the time it is called, and record the resulting status code.- Parameters:
status- The status for this op, determined by individual activity types- Returns:
- A FailedOp
-
getStartedAtNanos
long getStartedAtNanos()
Get the nanosecond instant which was recorded for this operation to be started. Specifically, this is when the operation was known to enter a native protocol or activity type section of logic which is more than just preparatory work by the client before execution.- Returns:
- nanoseconds started instant
-
getCurrentServiceTimeNanos
long getCurrentServiceTimeNanos()
Return the nanos that have elapsed since the op was started at the time of this call.- Returns:
- nanosecond service time duration
-
getCurrentResponseTimeNanos
long getCurrentResponseTimeNanos()
Return the nanos that have elapsed since this op was started at the time of this call, plus any prior waittime.- Returns:
- nanosecond response time duration
-
-