本文整理汇总了C#中CloseReason.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# CloseReason.ToString方法的具体用法?C# CloseReason.ToString怎么用?C# CloseReason.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CloseReason
的用法示例。
在下文中一共展示了CloseReason.ToString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
if (!WebJobsHelper.RunAsWebJobs)
Console.WriteLine(string.Format("Processor Shuting Down. Partition '{0}', Reason: '{1}'.",
partitionContext.Lease.PartitionId, reason.ToString()));
if (reason == CloseReason.Shutdown)
await context.CheckpointAsync();
}
示例2:
async Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason)
{
Console.WriteLine(string.Format("Processor Shuting Down. Partition '{0}', Reason: '{1}'.", context.Lease.PartitionId, reason.ToString()));
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例3: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
Trace.TraceInformation(string.Format("EventProcessor Shuting Down. Partition '{0}', Reason: '{1}'.", this.partitionContext.Lease.PartitionId, reason.ToString()));
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例4: CloseAsync
public Task CloseAsync(PartitionContext context, CloseReason reason)
{
Trace.TraceInformation("Processor Shuting Down. Partition '{0}', Reason: '{1}'.", this.Context.Lease.PartitionId, reason.ToString());
this.IsClosed = true;
this.OnProcessorClosed();
return context.CheckpointAsync();
}
示例5:
async Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason)
{
_logger.EventProcessorStopped(reason.ToString(), context.EventHubPath, context.ConsumerGroupName, context.Lease.PartitionId, context.Lease.Offset, context.Lease.Epoch);
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
_logger.EventProcessorCheckpointed(context.EventHubPath, context.ConsumerGroupName, context.Lease.PartitionId, context.Lease.Offset, context.Lease.Epoch);
}
}
示例6: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
Trace.TraceWarning("SimpleEventProcessor CloseAsync. Partition '{0}', Reason: '{1}'.",
this.partitionContext.Lease.PartitionId, reason.ToString());
_run = false;
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例7: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
Console.WriteLine(string.Format("StorageProcessor closing. Partition '{0}', Reason: '{1}'.", context.Lease.PartitionId, reason.ToString()));
_account = null;
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例8: CloseAsync
public virtual async Task CloseAsync(PartitionContext context, CloseReason reason)
{
Trace.WriteLine(string.Format("Processor Shuting Down. Partition '{0}', Reason: '{1}'."
, this.PartitionContext.Lease.PartitionId
, reason.ToString()));
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例9: CloseAsync
public Task CloseAsync(PartitionContext context, CloseReason reason)
{
this.telemetry.TrackTrace(
$"ClosePartition {context.Lease.PartitionId}: {reason}",
SeverityLevel.Information,
new Dictionary<string, string>
{
{ "PartitionId", context.Lease.PartitionId },
{ "Reason", reason.ToString() }
});
this.perfCounters.EventHub_Processors.Decrement();
return Task.FromResult(true);
}
示例10: wsServer_SessionClosed
static void wsServer_SessionClosed(WebSocketSession session, CloseReason value)
{
Console.WriteLine("wsServer_SessionClosed. SessionCount=["
+ session.AppServer.SessionCount.ToString() + "] CloseReason=[" + value.ToString() + "]");
}
示例11: CloseAsync
public Task CloseAsync(PartitionContext context, CloseReason reason)
{
Console.WriteLine(string.Format("EntityProcessor closing. Partition '{0}', Reason: '{1}'.", context.Lease.PartitionId, reason.ToString()));
return Task.FromResult<object>(null);
}
示例12: OnDisconnect
public void OnDisconnect(WebSocketSession session, CloseReason reason)
{
string address = session.RemoteEndPoint.Address + ":" + session.RemoteEndPoint.Port;
Player toRemove = GetPlayerByIP (address);
if (toRemove != null) { //Did the player get as far as logging in?
MainGame.entityHandler.RemoveEnt (toRemove);
Logger.LogMsg (toRemove.name + " disconnected from the server. Reason " + reason.ToString ());
}
}
示例13: appServer_SessionClosed
static void appServer_SessionClosed(WebSocketSession session, CloseReason reason)
{
Console.WriteLine("Somebody left " + reason.ToString());
}