本文整理汇总了C#中IEndpointInstance.Request方法的典型用法代码示例。如果您正苦于以下问题:C# IEndpointInstance.Request方法的具体用法?C# IEndpointInstance.Request怎么用?C# IEndpointInstance.Request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEndpointInstance
的用法示例。
在下文中一共展示了IEndpointInstance.Request方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Simple
async void Simple(IEndpointInstance endpoint, SendOptions sendOptions, ILog log)
{
#region EnumCallback
Message message = new Message();
Status response = await endpoint.Request<Status>(message, sendOptions);
log.Info("Callback received with response:" + response);
#endregion
}
示例2: SendEnumMessage
static async Task SendEnumMessage(IEndpointInstance endpointInstance)
{
Console.WriteLine("Message sent");
#region SendEnumMessage
EnumMessage message = new EnumMessage();
SendOptions sendOptions = new SendOptions();
sendOptions.SetDestination("Samples.Callbacks.Receiver");
Status status = await endpointInstance.Request<Status>(message, sendOptions);
Console.WriteLine("Callback received with status:" + status);
#endregion
}
示例3: Simple
async Task Simple(IEndpointInstance endpoint, SendOptions sendOptions, ILog log)
{
#region IntCallback
var message = new Message();
var response = await endpoint.Request<int>(message, sendOptions)
.ConfigureAwait(false);
log.Info("Callback received with response:" + response);
#endregion
}
示例4: Simple
async Task Simple(EndpointConfiguration endpointConfiguration, IEndpointInstance endpoint, SendOptions sendOptions)
{
#region 5to6-Callbacks-InstanceId
endpointConfiguration.ScaleOut().InstanceDiscriminator("uniqueId");
#endregion
#region 5to6-Callbacks
RequestMessage message = new RequestMessage();
ResponseMessage response = await endpoint.Request<ResponseMessage>(message, sendOptions);
#endregion
}
示例5: SendIntMessage
static async Task SendIntMessage(IEndpointInstance endpointInstance)
{
Console.WriteLine("Message sent");
#region SendIntMessage
IntMessage message = new IntMessage();
SendOptions sendOptions = new SendOptions();
sendOptions.SetDestination("Samples.Callbacks.Receiver");
int response = await endpointInstance.Request<int>(message, sendOptions);
Console.WriteLine("Callback received with response:" + response);
#endregion
}
示例6: SendObjectMessage
static async Task SendObjectMessage(IEndpointInstance endpointInstance)
{
Console.WriteLine("Message sent");
#region SendObjectMessage
var message = new ObjectMessage();
var sendOptions = new SendOptions();
sendOptions.SetDestination("Samples.Callbacks.Receiver");
var response = await endpointInstance.Request<ObjectResponseMessage>(message, sendOptions)
.ConfigureAwait(false);
Console.WriteLine("Callback received with response property value:" + response.Property);
#endregion
}