当前位置: 首页>>代码示例>>C#>>正文


C# CloseReason.ToString方法代码示例

本文整理汇总了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();
 }
开发者ID:danvy,项目名称:sigfox,代码行数:8,代码来源:EventProcessor.cs

示例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();
     }
 }
开发者ID:cefoot,项目名称:KAIT,代码行数:8,代码来源:EventProcessor.cs

示例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();
     }
 }
开发者ID:mickeyhaynes,项目名称:iot-hub-c-mbed-temperature-anomaly,代码行数:8,代码来源:SensorEventProcessor.cs

示例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();
        }
开发者ID:jmservera,项目名称:ConnectedChristmasTree,代码行数:9,代码来源:EventProcessor.cs

示例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);
            }
        }
开发者ID:Rurouni,项目名称:MassiveOnlineUniversalServerEngine,代码行数:10,代码来源:DelegatingEventProcessor.cs

示例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();
     }
 }
开发者ID:tzkwizard,项目名称:Azure,代码行数:10,代码来源:EventProcessor.cs

示例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();
            }
        }
开发者ID:jplane,项目名称:TheMartaBus.AzureServiceFabric,代码行数:11,代码来源:StorageProcessor.cs

示例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();
            }
        }
开发者ID:pdlg-spotlight,项目名称:lambda-architecture,代码行数:11,代码来源:LambdaEventProcessorBase.cs

示例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);
        }
开发者ID:XkhldY,项目名称:vowpal_wabbit,代码行数:15,代码来源:LearnEventProcessor.cs

示例10: wsServer_SessionClosed

 static void wsServer_SessionClosed(WebSocketSession session, CloseReason value)
 {
     Console.WriteLine("wsServer_SessionClosed. SessionCount=["
         + session.AppServer.SessionCount.ToString() + "] CloseReason=[" + value.ToString() + "]");
 }
开发者ID:afeng302,项目名称:WebSocket4Net,代码行数:5,代码来源:Program.cs

示例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);
        }
开发者ID:jplane,项目名称:TheMartaBus.AzureServiceFabric,代码行数:6,代码来源:EntityProcessor.cs

示例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 ());
     }
 }
开发者ID:Half-Shot,项目名称:gmud,代码行数:9,代码来源:MainServer.cs

示例13: appServer_SessionClosed

 static void appServer_SessionClosed(WebSocketSession session, CloseReason reason)
 {
     Console.WriteLine("Somebody left " + reason.ToString());
 }
开发者ID:flo-l,项目名称:brettspiel,代码行数:4,代码来源:Program.cs


注:本文中的CloseReason.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。