• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Orleans类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Orleans的典型用法代码示例。如果您正苦于以下问题:C# Orleans类的具体用法?C# Orleans怎么用?C# Orleans使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Orleans类属于命名空间,在下文中一共展示了Orleans类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Init

 public Task Init(string name, Orleans.Providers.IProviderRuntime providerRuntime, Orleans.Providers.IProviderConfiguration config)
 {
     //// prepare provider
     this.Name = name;
     this.directory = config.Properties["directory"];
     return TaskDone.Done;
 }
开发者ID:moonytheloony,项目名称:microsoftorleans,代码行数:7,代码来源:FileStorageProvider.cs


示例2: ClearStateAsync

        public Task ClearStateAsync(string grainType, Orleans.GrainReference grainReference, Orleans.GrainState grainState)
        {
            if (!(grainState is IAggregateState))
                throw new NotAggregateStateException(grainState.GetType());

            var state = grainState as IAggregateState;
            var stream = this.GetStreamName(grainType, grainReference);

            return this.Connection.DeleteStreamAsync(stream, state.Version);
        }
开发者ID:jkonecki,项目名称:Orleans.EventSourcing,代码行数:10,代码来源:EventStoreProvider.cs


示例3: WriteStateAsync

 public Task WriteStateAsync(string grainType, Orleans.Runtime.GrainReference grainReference, Orleans.IGrainState grainState)
 {
     var json = JsonConvert.SerializeObject(grainState.AsDictionary());
     var fileInfo = this.GetFileInfo(grainType, grainReference);
     using (var stream = fileInfo.OpenWrite())
     {
         using (var writer = new StreamWriter(stream))
         {
             return writer.WriteAsync(json);
         }
     }
 }
开发者ID:moonytheloony,项目名称:microsoftorleans,代码行数:12,代码来源:FileStorageProvider.cs


示例4: ReadStateAsync

        public async Task ReadStateAsync(string grainType, Orleans.Runtime.GrainReference grainReference, Orleans.IGrainState grainState)
        {
            var fileInfo = this.GetFileInfo(grainType, grainReference);
            if (!fileInfo.Exists)
            {
                return;
            }

            using (var stream = fileInfo.OpenText())
            {
                var json = await stream.ReadToEndAsync();
                var data = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
                grainState.SetAll(data);
            }
        }
开发者ID:moonytheloony,项目名称:microsoftorleans,代码行数:15,代码来源:FileStorageProvider.cs


示例5: Init

        public Task Init(string name, Orleans.Providers.IProviderRuntime providerRuntime, Orleans.Providers.IProviderConfiguration config)
        {
            this.Name = name;
            this.Log = providerRuntime.GetLogger(this.GetType().FullName, Logger.LoggerType.Application);

            // Create EventStore connection
            var username = config.Properties.ContainsKey("Username") ? config.Properties["Username"] : "admin";
            var password = config.Properties.ContainsKey("Password") ? config.Properties["Password"] : "changeit";

            var settings = ConnectionSettings.Create()
                .KeepReconnecting().KeepRetrying()
                .SetDefaultUserCredentials(new UserCredentials(username, password));

            // Connection string format: <hostName>:<port>
            var connectionStringParts = config.Properties["ConnectionString"].Split(':'); 
            var hostName = connectionStringParts[0];
            var hostPort = int.Parse(connectionStringParts[1]);
            var hostAddress = Dns.GetHostAddresses(hostName).First(a => a.AddressFamily == AddressFamily.InterNetwork);

            this.Connection = EventStoreConnection.Create(settings, new IPEndPoint(hostAddress, hostPort));

            // Connect to EventStore
            return this.Connection.ConnectAsync();
        }
开发者ID:timfun,项目名称:orleans.eventsourcing,代码行数:24,代码来源:EventStoreProvider.cs


示例6: Deserializer

 public static object Deserializer(System.Type expected, Orleans.Serialization.BinaryTokenStreamReader stream)
 {
     Orleans.PingPong.Message result = new Orleans.PingPong.Message();
     return result;
 }
开发者ID:rikace,项目名称:Orleans.PingPong,代码行数:5,代码来源:orleans.codegen.cs


示例7: Ping

            public System.Threading.Tasks.Task Ping(Orleans.PingPong.IClient from, Orleans.PingPong.Message message)
            {

                return base.InvokeMethodAsync<object>(1491328371, new object[] {from is GrainBase ? Orleans.PingPong.ClientFactory.Cast(from.AsReference()) : from, message}, TimeSpan.Zero );
            }
开发者ID:rikace,项目名称:Orleans.PingPong,代码行数:5,代码来源:orleans.codegen.cs


示例8: Subscribe

            public System.Threading.Tasks.Task Subscribe(Orleans.PingPong.IClientObserver subscriber)
            {
GrainFactoryBase.CheckGrainObserverParamInternal(subscriber);

                return base.InvokeMethodAsync<object>(-1238941369, new object[] {subscriber is GrainBase ? Orleans.PingPong.ClientObserverFactory.Cast(subscriber.AsReference()) : subscriber}, TimeSpan.Zero );
            }
开发者ID:rikace,项目名称:Orleans.PingPong,代码行数:6,代码来源:orleans.codegen.cs


示例9: Pong

            public System.Threading.Tasks.Task Pong(Orleans.PingPong.IDestination from, Orleans.PingPong.Message message)
            {

                return base.InvokeMethodAsync<object>(-2060440583, new object[] {from is GrainBase ? Orleans.PingPong.DestinationFactory.Cast(from.AsReference()) : from, message}, TimeSpan.Zero );
            }
开发者ID:rikace,项目名称:Orleans.PingPong,代码行数:5,代码来源:orleans.codegen.cs


示例10: Serializer

 public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected)
 {
     Example.InventoryItemDeactivated input = ((Example.InventoryItemDeactivated)(untypedInput));
 }
开发者ID:DarkHarlock,项目名称:Orleankka,代码行数:4,代码来源:orleans.codegen.cs


示例11:

            System.Threading.Tasks.Task Orleans.Samples.Chirper.GrainInterfaces.IChirperPublisher.RemoveFollower(string @userAlias, Orleans.Samples.Chirper.GrainInterfaces.IChirperSubscriber @follower)
            {

                return base.InvokeMethodAsync<object>(-370855882, new object[] {@userAlias, @follower is global::Orleans.Grain ? @follower.AsReference<Orleans.Samples.Chirper.GrainInterfaces.IChirperSubscriber>() : @follower} );
            }
开发者ID:dVakulen,项目名称:JASN-vNext,代码行数:5,代码来源:orleans.codegen.cs


示例12: Serializer

 public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected)
 {
     JASN.Core.Customer input = ((JASN.Core.Customer)(untypedInput));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Id, stream, typeof(int));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Name, stream, typeof(string));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Total, stream, typeof(decimal));
 }
开发者ID:dVakulen,项目名称:JASN-vNext,代码行数:7,代码来源:orleans.codegen.cs


示例13: Serializer

 public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected)
 {
     Test.Interfaces.PersonalAttributes input = ((Test.Interfaces.PersonalAttributes)(untypedInput));
     Orleans.Serialization.SerializationManager.SerializeInner(input.FirstName, stream, typeof(string));
     Orleans.Serialization.SerializationManager.SerializeInner(input.LastName, stream, typeof(string));
 }
开发者ID:SmartFire,项目名称:orleans.storageprovider.documentdb,代码行数:6,代码来源:orleans.codegen.cs


示例14: Serializer

 public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected)
 {
     Microsoft.AspNet.SignalR.Messaging.Message input = ((Microsoft.AspNet.SignalR.Messaging.Message)(untypedInput));
     Orleans.Serialization.SerializationManager.SerializeInner(input.CommandId, stream, typeof(String));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Encoding, stream, typeof(Encoding));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Filter, stream, typeof(String));
     Orleans.Serialization.SerializationManager.SerializeInner(input.IsAck, stream, typeof(Boolean));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Key, stream, typeof(String));
     Orleans.Serialization.SerializationManager.SerializeInner(input.MappingId, stream, typeof(UInt64));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Source, stream, typeof(String));
     Orleans.Serialization.SerializationManager.SerializeInner(input.StreamIndex, stream, typeof(Int32));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Value, stream, typeof(ArraySegment<Byte>));
     Orleans.Serialization.SerializationManager.SerializeInner(input.WaitForAck, stream, typeof(Boolean));
 }
开发者ID:tareq-s,项目名称:OrleansR,代码行数:14,代码来源:orleans.codegen.cs


示例15: Initialize

            public System.Threading.Tasks.Task Initialize(Orleans.PingPong.IDestination actor, long repeats)
            {

                return base.InvokeMethodAsync<object>(1682027821, new object[] {actor is GrainBase ? Orleans.PingPong.DestinationFactory.Cast(actor.AsReference()) : actor, repeats}, TimeSpan.Zero );
            }
开发者ID:rikace,项目名称:Orleans.PingPong,代码行数:5,代码来源:orleans.codegen.cs


示例16: _Deserializer

 public static object _Deserializer(System.Type expected, Orleans.Serialization.BinaryTokenStreamReader stream)
 {
     return DestinationReference.Cast(((Orleans.GrainReference)(GrainReference.DeserializeGrainReference(expected, stream))));
 }
开发者ID:rikace,项目名称:Orleans.PingPong,代码行数:4,代码来源:orleans.codegen.cs


示例17: Serializer

 public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected)
 {
     Orleans.PingPong.Message input = ((Orleans.PingPong.Message)(untypedInput));
 }
开发者ID:rikace,项目名称:Orleans.PingPong,代码行数:4,代码来源:orleans.codegen.cs


示例18: Serializer

 public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected)
 {
     EventJournal.Event input = ((EventJournal.Event)(untypedInput));
     Orleans.Serialization.SerializationManager.SerializeInner(input.AdditionalData, stream, typeof(System.Collections.Generic.IDictionary<System.String,Newtonsoft.Json.Linq.JToken>));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Arguments, stream, typeof(object[]));
     Orleans.Serialization.SerializationManager.SerializeInner(input.CorrelationId, stream, typeof(System.Guid));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Extras, stream, typeof(System.Collections.Generic.Dictionary<System.String,System.Object>));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Id, stream, typeof(long));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Time, stream, typeof(System.DateTime));
     Orleans.Serialization.SerializationManager.SerializeInner(input.To, stream, typeof(EventJournal.Address));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Type, stream, typeof(string));
     Orleans.Serialization.SerializationManager.SerializeInner(input.UserId, stream, typeof(System.Nullable<System.Guid>));
 }
开发者ID:Bee-Htcpcp,项目名称:OrleansEventJournal,代码行数:13,代码来源:orleans.codegen.cs


示例19: _Serializer

 public static void _Serializer(object original, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected)
 {
     ClientReference input = ((ClientReference)(original));
     GrainReference.SerializeGrainReference(input, stream, expected);
 }
开发者ID:rikace,项目名称:Orleans.PingPong,代码行数:5,代码来源:orleans.codegen.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# OrmLiteConnectionFactory类代码示例发布时间:2022-05-24
下一篇:
C# OrientationChangedEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap