Skip to main content

TestService

Type Aliases​

GetCurrentTime()​

GetCurrentTime = void

GetCurrentTime returns the current Temporal Test Server time

This time might not be equal to System#currentTimeMillis() due to time skipping.

Call Signature​

GetCurrentTime(request, callback): void

GetCurrentTime returns the current Temporal Test Server time

This time might not be equal to System#currentTimeMillis() due to time skipping.

Parameters​
request​

IEmpty

callback​

GetCurrentTimeCallback

Returns​

void

Call Signature​

GetCurrentTime(request): Promise<GetCurrentTimeResponse>

GetCurrentTime returns the current Temporal Test Server time

This time might not be equal to System#currentTimeMillis() due to time skipping.

Parameters​
request​

IEmpty

Returns​

Promise<GetCurrentTimeResponse>

Properties​

name​

readonly name: "GetCurrentTime"

path​

readonly path: "/temporal.api.testservice.v1.TestService/GetCurrentTime"

requestStream​

readonly requestStream: undefined

requestType​

readonly requestType: "google.protobuf.Empty"

responseStream​

readonly responseStream: undefined

responseType​

readonly responseType: "GetCurrentTimeResponse"


GetCurrentTimeCallback​

GetCurrentTimeCallback = (error, response?) => void

Callback as used by temporal.api.testservice.v1.TestService#getCurrentTime.

Parameters​

error​

Error | null

Error, if any

response?​

GetCurrentTimeResponse

GetCurrentTimeResponse

Returns​

void


LockTimeSkipping()​

LockTimeSkipping = void

LockTimeSkipping increments Time Locking Counter by one.

If Time Locking Counter is positive, time skipping is locked (disabled). When time skipping is disabled, the time in test server is moving normally, with a real time pace. Test Server is typically started with locked time skipping and Time Locking Counter = 1.

LockTimeSkipping and UnlockTimeSkipping calls are counted.

Call Signature​

LockTimeSkipping(request, callback): void

LockTimeSkipping increments Time Locking Counter by one.

If Time Locking Counter is positive, time skipping is locked (disabled). When time skipping is disabled, the time in test server is moving normally, with a real time pace. Test Server is typically started with locked time skipping and Time Locking Counter = 1.

LockTimeSkipping and UnlockTimeSkipping calls are counted.

Parameters​
request​

ILockTimeSkippingRequest

callback​

LockTimeSkippingCallback

Returns​

void

Call Signature​

LockTimeSkipping(request): Promise<LockTimeSkippingResponse>

LockTimeSkipping increments Time Locking Counter by one.

If Time Locking Counter is positive, time skipping is locked (disabled). When time skipping is disabled, the time in test server is moving normally, with a real time pace. Test Server is typically started with locked time skipping and Time Locking Counter = 1.

LockTimeSkipping and UnlockTimeSkipping calls are counted.

Parameters​
request​

ILockTimeSkippingRequest

Returns​

Promise<LockTimeSkippingResponse>

Properties​

name​

readonly name: "LockTimeSkipping"

path​

readonly path: "/temporal.api.testservice.v1.TestService/LockTimeSkipping"

requestStream​

readonly requestStream: undefined

requestType​

readonly requestType: "LockTimeSkippingRequest"

responseStream​

readonly responseStream: undefined

responseType​

readonly responseType: "LockTimeSkippingResponse"


LockTimeSkippingCallback​

LockTimeSkippingCallback = (error, response?) => void

Callback as used by temporal.api.testservice.v1.TestService#lockTimeSkipping.

Parameters​

error​

Error | null

Error, if any

response?​

LockTimeSkippingResponse

LockTimeSkippingResponse

Returns​

void


Sleep()​

Sleep = void

This call returns only when the Test Server Time advances by the specified duration. This is an EXPERIMENTAL API.

Call Signature​

Sleep(request, callback): void

This call returns only when the Test Server Time advances by the specified duration. This is an EXPERIMENTAL API.

Parameters​
request​

ISleepRequest

callback​

SleepCallback

Returns​

void

Call Signature​

Sleep(request): Promise<SleepResponse>

This call returns only when the Test Server Time advances by the specified duration. This is an EXPERIMENTAL API.

Parameters​
request​

ISleepRequest

Returns​

Promise<SleepResponse>

Properties​

name​

readonly name: "Sleep"

path​

readonly path: "/temporal.api.testservice.v1.TestService/Sleep"

requestStream​

readonly requestStream: undefined

requestType​

readonly requestType: "SleepRequest"

responseStream​

readonly responseStream: undefined

responseType​

readonly responseType: "SleepResponse"


SleepCallback​

SleepCallback = (error, response?) => void

Callback as used by temporal.api.testservice.v1.TestService#sleep.

Parameters​

error​

Error | null

Error, if any

response?​

SleepResponse

SleepResponse

Returns​

void


SleepUntil()​

SleepUntil = void

This call returns only when the Test Server Time advances to the specified timestamp. If the current Test Server Time is beyond the specified timestamp, returns immediately. This is an EXPERIMENTAL API.

Call Signature​

SleepUntil(request, callback): void

This call returns only when the Test Server Time advances to the specified timestamp. If the current Test Server Time is beyond the specified timestamp, returns immediately. This is an EXPERIMENTAL API.

Parameters​
request​

ISleepUntilRequest

callback​

SleepUntilCallback

Returns​

void

Call Signature​

SleepUntil(request): Promise<SleepResponse>

This call returns only when the Test Server Time advances to the specified timestamp. If the current Test Server Time is beyond the specified timestamp, returns immediately. This is an EXPERIMENTAL API.

Parameters​
request​

ISleepUntilRequest

Returns​

Promise<SleepResponse>

Properties​

name​

readonly name: "SleepUntil"

path​

readonly path: "/temporal.api.testservice.v1.TestService/SleepUntil"

requestStream​

readonly requestStream: undefined

requestType​

readonly requestType: "SleepUntilRequest"

responseStream​

readonly responseStream: undefined

responseType​

readonly responseType: "SleepResponse"


SleepUntilCallback​

SleepUntilCallback = (error, response?) => void

Callback as used by temporal.api.testservice.v1.TestService#sleepUntil.

Parameters​

error​

Error | null

Error, if any

response?​

SleepResponse

SleepResponse

Returns​

void


UnlockTimeSkipping()​

UnlockTimeSkipping = void

UnlockTimeSkipping decrements Time Locking Counter by one.

If the counter reaches 0, it unlocks time skipping and fast forwards time. LockTimeSkipping and UnlockTimeSkipping calls are counted. Calling UnlockTimeSkipping does not guarantee that time is going to be fast forwarded as another lock can be holding it.

Time Locking Counter can't be negative, unbalanced calls to UnlockTimeSkipping will lead to rpc call failure

Call Signature​

UnlockTimeSkipping(request, callback): void

UnlockTimeSkipping decrements Time Locking Counter by one.

If the counter reaches 0, it unlocks time skipping and fast forwards time. LockTimeSkipping and UnlockTimeSkipping calls are counted. Calling UnlockTimeSkipping does not guarantee that time is going to be fast forwarded as another lock can be holding it.

Time Locking Counter can't be negative, unbalanced calls to UnlockTimeSkipping will lead to rpc call failure

Parameters​
request​

IUnlockTimeSkippingRequest

callback​

UnlockTimeSkippingCallback

Returns​

void

Call Signature​

UnlockTimeSkipping(request): Promise<UnlockTimeSkippingResponse>

UnlockTimeSkipping decrements Time Locking Counter by one.

If the counter reaches 0, it unlocks time skipping and fast forwards time. LockTimeSkipping and UnlockTimeSkipping calls are counted. Calling UnlockTimeSkipping does not guarantee that time is going to be fast forwarded as another lock can be holding it.

Time Locking Counter can't be negative, unbalanced calls to UnlockTimeSkipping will lead to rpc call failure

Parameters​
request​

IUnlockTimeSkippingRequest

Returns​

Promise<UnlockTimeSkippingResponse>

Properties​

name​

readonly name: "UnlockTimeSkipping"

path​

readonly path: "/temporal.api.testservice.v1.TestService/UnlockTimeSkipping"

requestStream​

readonly requestStream: undefined

requestType​

readonly requestType: "UnlockTimeSkippingRequest"

responseStream​

readonly responseStream: undefined

responseType​

readonly responseType: "UnlockTimeSkippingResponse"


UnlockTimeSkippingCallback​

UnlockTimeSkippingCallback = (error, response?) => void

Callback as used by temporal.api.testservice.v1.TestService#unlockTimeSkipping.

Parameters​

error​

Error | null

Error, if any

response?​

UnlockTimeSkippingResponse

UnlockTimeSkippingResponse

Returns​

void


UnlockTimeSkippingWithSleep()​

UnlockTimeSkippingWithSleep = void

UnlockTimeSkippingWhileSleep decreases time locking counter by one and increases it back once the Test Server Time advances by the duration specified in the request.

This call returns only when the Test Server Time advances by the specified duration.

If it is called when Time Locking Counter is

  • more than 1 and no other unlocks are coming in, rpc call will block for the specified duration, time will not be fast forwarded.
  • 1, it will lead to fast forwarding of the time by the duration specified in the request and quick return of this rpc call.
  • 0 will lead to rpc call failure same way as an unbalanced UnlockTimeSkipping.

Call Signature​

UnlockTimeSkippingWithSleep(request, callback): void

UnlockTimeSkippingWhileSleep decreases time locking counter by one and increases it back once the Test Server Time advances by the duration specified in the request.

This call returns only when the Test Server Time advances by the specified duration.

If it is called when Time Locking Counter is

  • more than 1 and no other unlocks are coming in, rpc call will block for the specified duration, time will not be fast forwarded.
  • 1, it will lead to fast forwarding of the time by the duration specified in the request and quick return of this rpc call.
  • 0 will lead to rpc call failure same way as an unbalanced UnlockTimeSkipping.
Parameters​
request​

ISleepRequest

callback​

UnlockTimeSkippingWithSleepCallback

Returns​

void

Call Signature​

UnlockTimeSkippingWithSleep(request): Promise<SleepResponse>

UnlockTimeSkippingWhileSleep decreases time locking counter by one and increases it back once the Test Server Time advances by the duration specified in the request.

This call returns only when the Test Server Time advances by the specified duration.

If it is called when Time Locking Counter is

  • more than 1 and no other unlocks are coming in, rpc call will block for the specified duration, time will not be fast forwarded.
  • 1, it will lead to fast forwarding of the time by the duration specified in the request and quick return of this rpc call.
  • 0 will lead to rpc call failure same way as an unbalanced UnlockTimeSkipping.
Parameters​
request​

ISleepRequest

Returns​

Promise<SleepResponse>

Properties​

name​

readonly name: "UnlockTimeSkippingWithSleep"

path​

readonly path: "/temporal.api.testservice.v1.TestService/UnlockTimeSkippingWithSleep"

requestStream​

readonly requestStream: undefined

requestType​

readonly requestType: "SleepRequest"

responseStream​

readonly responseStream: undefined

responseType​

readonly responseType: "SleepResponse"


UnlockTimeSkippingWithSleepCallback​

UnlockTimeSkippingWithSleepCallback = (error, response?) => void

Callback as used by temporal.api.testservice.v1.TestService#unlockTimeSkippingWithSleep.

Parameters​

error​

Error | null

Error, if any

response?​

SleepResponse

SleepResponse

Returns​

void