C-DEngine 5.105

TheCommRequestResponse..::..PublishRequestJsonCallback<(Of <(<'inputT, outputT>)>)> Method

Sends a message with JSON-serialized parameters to the targetThing and returns the payload of the response message to the callback as a deserialized object.

Namespace:  nsCDEngine.Communication
Assembly:  C-DEngine (in C-DEngine.dll)

Syntax


public static void PublishRequestJsonCallback<inputT, outputT>(
	TheMessageAddress originator,
	TheMessageAddress target,
	inputT messageParameters,
	TimeSpan timeout,
	Action<outputT> responseCallback
)
Public Shared Sub PublishRequestJsonCallback(Of inputT, outputT) ( _
	originator As TheMessageAddress, _
	target As TheMessageAddress, _
	messageParameters As inputT, _
	timeout As TimeSpan, _
	responseCallback As Action(Of outputT) _
)
public:
generic<typename inputT, typename outputT>
static void PublishRequestJsonCallback(
	TheMessageAddress^ originator, 
	TheMessageAddress^ target, 
	inputT messageParameters, 
	TimeSpan^ timeout, 
	Action<outputT>^ responseCallback
)

Type Parameters

inputT
outputT

Parameters

originator
Type: nsCDEngine.Communication..::..TheMessageAddress
Thing or engine to use for response messages. If NULL defaults to ContentService.
target
Type: nsCDEngine.Communication..::..TheMessageAddress
Thing or engine to which the message is to be sent.
messageParameters
Type: inputT
The object to send as the payload of the message.
timeout
Type: TimeSpan
If the response message is not returned to the callback within this time, the callback will be invoked with the default of outputT as a parameter.
responseCallback
Type: Action<(Of <(<'outputT>)>)>
The method that will be called once the response message has been received or a timeout has occured. The parameter will contain the deserialized payload of the response message, or the default of outputT if a timeout occurs.