Table of Contents

Method PostEventAsync

Namespace
Scaleout.Client
Assembly
Scaleout.Client.dll

PostEventAsync(TKey, string, byte[], string, TimeSpan?)

Posts an event that is associated with a StateServer object. The event will be handled remotely on the host where the object resides by an Invocation Grid worker process.

public Task<InvokeResponse> PostEventAsync(TKey key, string eventInfo, byte[] payload, string invocationGrid, TimeSpan? invokeTimeout = null)

Parameters

key TKey

Identifier of the object in the cache.

eventInfo string

Arbitrary string identifying the event.

payload byte[]

Optional payload (typically a serialized object).

invocationGrid string

The name of the invocation grid to send the event to.

invokeTimeout TimeSpan?

The amount of time allowed for this operation. After the expires, the operation will be canceled. You may specify null or Zero if you want the operation to continue no matter how long it takes. If the timeout elapses, a TimeoutException or OperationCanceledException will be thrown (depending on whether the timeout occurred in the service or in the client process).

Returns

Task<InvokeResponse>

InvokeResponse indicating the outcome of the operation. Result will be set to Posted if successful or UnhandledExceptionInCallback if the callback handling the posted event in the server threw an unhandled exception.

Remarks

The Result property of the response will contain one of the following ServerResult outcomes:

ServerResultDescription
PostedThe event was successfully posted to the ScaleOut service.
UnhandledExceptionInCallback An unhandled exception was thrown from the callback processing the posted event. Check ErrorData for details (this is typically a UTF8 encoded string, but if a different library processed the event on the server then another encoding may have been used).

Exceptions

NotReadyException

The ScaleOut service is not yet ready to perform this operation, typically because there was no application registered to handle events for this cache.

TimeoutException

The operation timed out in the server and the invokeTimeout elapsed.

OperationCanceledException

The operation timed out, typically because too many pending requests accumulated in the client and the invokeTimeout elapsed.

See Also
SetPostedEventHandlerAsync<TKey, TValue>(Cache<TKey, TValue>, Func<TKey, EventPayload, Task>)

PostEventAsync(TKey, string, byte[], TimeSpan?)

Posts an event that is associated with a StateServer object. The event will be handled remotely on the host where the object resides.

public Task<InvokeResponse> PostEventAsync(TKey key, string eventInfo, byte[] payload, TimeSpan? invokeTimeout = null)

Parameters

key TKey

Identifier of the object in the cache.

eventInfo string

Arbitrary string identifying the event.

payload byte[]

Optional payload (typically a serialized object).

invokeTimeout TimeSpan?

The amount of time allowed for this operation. After the expires, the operation will be canceled. You may specify null or Zero if you want the operation to continue no matter how long it takes. If the timeout elapses, a TimeoutException or OperationCanceledException will be thrown (depending on whether the timeout occurred in the service or in the client process).

Returns

Task<InvokeResponse>

InvokeResponse indicating the outcome of the operation. Result will be set to Posted if successful or UnhandledExceptionInCallback if the callback handling the posted event in the server threw an unhandled exception.

Remarks

The Result property of the response will contain one of the following ServerResult outcomes:

ServerResultDescription
PostedThe event was successfully posted to the ScaleOut service.
UnhandledExceptionInCallback An unhandled exception was thrown from the callback processing the posted event. Check ErrorData for details (this is typically a UTF8 encoded string, but if a different library processed the event on the server then another encoding may have been used).

Exceptions

NotReadyException

The ScaleOut service is not yet ready to perform this operation, typically because there was no application registered to handle events for this cache.

TimeoutException

The operation timed out in the server and the invokeTimeout elapsed.

OperationCanceledException

The operation timed out, typically because too many pending requests accumulated in the client and the invokeTimeout elapsed.

See Also
SetPostedEventHandlerAsync<TKey, TValue>(Cache<TKey, TValue>, Func<TKey, EventPayload, Task>)

PostEventAsync(TKey, string, byte[], uint, TimeSpan?)

Posts an event that is associated with a StateServer object. The event will be handled remotely on the host where the object resides by an Invocation Grid worker process. (This overload is typically only used to support internal product infrastructure.)

public Task<InvokeResponse> PostEventAsync(TKey key, string eventInfo, byte[] payload, uint igID, TimeSpan? invokeTimeout = null)

Parameters

key TKey

Identifier of the object in the cache.

eventInfo string

Arbitrary string identifying the event.

payload byte[]

Optional payload (typically a serialized object).

igID uint

Identifier of the Invocation Grid to send the event to.

invokeTimeout TimeSpan?

The amount of time allowed for this operation. After the expires, the operation will be canceled. You may specify null or Zero if you want the operation to continue no matter how long it takes. If the timeout elapses, a TimeoutException or OperationCanceledException will be thrown (depending on whether the timeout occurred in the service or in the client process).

Returns

Task<InvokeResponse>

InvokeResponse indicating the outcome of the operation. Result will be set to Posted if successful or UnhandledExceptionInCallback if the callback handling the posted event in the server threw an unhandled exception.

Remarks

This overload is intended for use in rare scenarios when the service's internal numeric Invocation Grid identifier is known but its string name is not.

The Result property of the response will contain one of the following ServerResult outcomes:

ServerResultDescription
PostedThe event was successfully posted to the ScaleOut service.
UnhandledExceptionInCallback An unhandled exception was thrown from the callback processing the posted event. Check ErrorData for details (this is typically a UTF8 encoded string, but if a different library processed the event on the server then another encoding may have been used).

Exceptions

NotReadyException

The ScaleOut service is not yet ready to perform this operation, typically because there was no application registered to handle events for this cache.

TimeoutException

The operation timed out in the server and the invokeTimeout elapsed.

OperationCanceledException

The operation timed out, typically because too many pending requests accumulated in the client and the invokeTimeout elapsed.

See Also
SetPostedEventHandler<TKey, TValue>(Cache<TKey, TValue>, Action<TKey, EventPayload>)