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


C# IRuntime.AddActor方法代码示例

本文整理汇总了C#中IRuntime.AddActor方法的典型用法代码示例。如果您正苦于以下问题:C# IRuntime.AddActor方法的具体用法?C# IRuntime.AddActor怎么用?C# IRuntime.AddActor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRuntime的用法示例。


在下文中一共展示了IRuntime.AddActor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateIndexBuilder

 private static int CreateIndexBuilder(IRuntime runtime, int manager, HttpListenerResponse response, string path, int reader)
 {
     // item 883
     var builder = new IndexBuilder();
     builder.Manager = manager;
     builder.FolderReader = reader;
     builder.Folder = path;
     builder.Response = response;
     // item 884
     int actorId = runtime.AddActor(builder);
     // item 886
     runtime.SendMessage(
     actorId,
     Codes.Start,
     null,
     0
     );
     // item 885
     return actorId;
 }
开发者ID:snjee,项目名称:actor-http,代码行数:20,代码来源:HttpActors.cs

示例2: CreatePumpFromBytes

 private static int CreatePumpFromBytes(IRuntime runtime, int manager, HttpListenerResponse response, byte[] responseData, int responseCode)
 {
     // item 744
     response.StatusCode = responseCode;
     response.ContentLength64 = responseData.Length;
     // item 740
     var pump = new StreamPump();
     pump.Manager = manager;
     pump.OutStream = response.OutputStream;
     pump.OutBuffer.Data = responseData;
     pump.OutBuffer.Count = responseData.Length;
     // item 745
     pump.CurrentState = StreamPump.StateNames.SendRemaining;
     // item 741
     int id = runtime.AddActor(pump);
     // item 746
     runtime.StartWrite(
     pump.OutStream,
     pump.OutBuffer,
     id
     );
     // item 742
     return id;
 }
开发者ID:snjee,项目名称:actor-http,代码行数:24,代码来源:HttpActors.cs

示例3: CreateFilePump

 private static int CreateFilePump(IRuntime runtime, string path, int manager, HttpListenerResponse response)
 {
     // item 697
     if (File.Exists(path)) {
     // item 698
     Stream fstream = TryOpenFile(path);
     // item 699
     if (fstream == null) {
         // item 703
         runtime.Log.Info(
             "Could not open file: "
             + path
         );
         // item 701
         return 0;
     } else {
         // item 691
         FileInfo about = new FileInfo(path);
         // item 696
         runtime.Log.Info(
             String.Format(
                 "Found file: {0}. Length: {1}",
                 path,
                 (int)about.Length
             )
         );
         // item 689
         var pump = new StreamPump();
         pump.Manager = manager;
         pump.TotalLength = (int)about.Length;
         pump.InStream = fstream;
         pump.OutStream = response.OutputStream;
         // item 690
         int id = runtime.AddActor(pump);
         // item 692
         response.StatusCode = 200;
         response.ContentLength64 = pump.TotalLength;
         // item 694
         runtime.StartRead(
             pump.InStream,
             pump.InBuffer,
             id
         );
         // item 695
         return id;
     }
     } else {
     // item 702
     runtime.Log.Info(
         "File not found: "
         + path
     );
     // item 701
     return 0;
     }
 }
开发者ID:snjee,项目名称:actor-http,代码行数:56,代码来源:HttpActors.cs


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