コード例 #1
0
ファイル: GraphEventManager.cs プロジェクト: saleyn/agni
        public override void EmitEvent(Event evt)
        {
            var pair = HostSet.AssignHost(evt.G_EmitterNode);

            Contracts.ServiceClientHub
            .CallWithRetry <IGraphEventSystemClient>(eventSystem => eventSystem.EmitEvent(evt), pair.Select(host => host.RegionPath));
        }
コード例 #2
0
ファイル: GraphEventManager.cs プロジェクト: saleyn/agni
        public override void Unsubscribe(GDID gRecipientNode, GDID gEmitterNode)
        {
            var pair = HostSet.AssignHost(gEmitterNode);

            Contracts.ServiceClientHub
            .CallWithRetry <IGraphEventSystemClient>(eventSystem => eventSystem.Unsubscribe(gRecipientNode, gEmitterNode), pair.Select(host => host.RegionPath));
        }
コード例 #3
0
ファイル: GraphFriendManager.cs プロジェクト: saleyn/agni
        public override GraphChangeStatus AddFriendList(GDID gNode, string list, string description)
        {
            var pair = HostSet.AssignHost(gNode);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphFriendSystemClient, GraphChangeStatus>(friendSystem => friendSystem.AddFriendList(gNode, list, description), pair.Select(host => host.RegionPath)));
        }
コード例 #4
0
ファイル: GraphFriendManager.cs プロジェクト: saleyn/agni
        public override IEnumerable <FriendConnection> GetFriendConnections(FriendQuery query)
        {
            var pair = HostSet.AssignHost(query.G_Node);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphFriendSystemClient, IEnumerable <FriendConnection> >(friendSystem => friendSystem.GetFriendConnections(query), pair.Select(host => host.RegionPath)));
        }
コード例 #5
0
ファイル: GraphFriendManager.cs プロジェクト: saleyn/agni
        public override GraphChangeStatus DeleteFriend(GDID gNode, GDID gFriendNode)
        {
            var pair = HostSet.AssignHost(gNode);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphFriendSystemClient, GraphChangeStatus>(friendSystem => friendSystem.DeleteFriend(gNode, gFriendNode), pair.Select(host => host.RegionPath)));
        }
コード例 #6
0
ファイル: GraphEventManager.cs プロジェクト: saleyn/agni
        public override IEnumerable <GraphNode> GetSubscribers(GDID gEmitterNode, long start, int count)
        {
            var pair = HostSet.AssignHost(gEmitterNode);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphEventSystemClient, IEnumerable <GraphNode> >(eventSystem => eventSystem.GetSubscribers(gEmitterNode, start, count), pair.Select(host => host.RegionPath)));
        }
コード例 #7
0
ファイル: GraphEventManager.cs プロジェクト: saleyn/agni
        public override long EstimateSubscriberCount(GDID gEmitterNode)
        {
            var pair = HostSet.AssignHost(gEmitterNode);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphEventSystemClient, long>(eventSystem => eventSystem.EstimateSubscriberCount(gEmitterNode), pair.Select(host => host.RegionPath)));
        }
コード例 #8
0
ファイル: GraphFriendManager.cs プロジェクト: saleyn/agni
        public override IEnumerable <string> GetFriendLists(GDID gNode)
        {
            var pair = HostSet.AssignHost(gNode);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphFriendSystemClient, IEnumerable <string> >(friendSystem => friendSystem.GetFriendLists(gNode), pair.Select(host => host.RegionPath)));
        }
コード例 #9
0
        public override GraphChangeStatus Complain(CommentID commentId, GDID gAuthorNode, string kind, string message)
        {
            var pair = HostSet.AssignHost(commentId.G_Volume);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, GraphChangeStatus>(
                       commentSystem => commentSystem.Complain(commentId, gAuthorNode, kind, message),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #10
0
        public override IEnumerable <SummaryRating> GetNodeSummaries(GDID gNode)
        {
            var pair = HostSet.AssignHost(gNode);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, IEnumerable <SummaryRating> >(
                       commentSystem => commentSystem.GetNodeSummaries(gNode),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #11
0
        public override bool IsCommentedByAuthor(GDID gNode, GDID gAuthor, string dimension)
        {
            var pair = HostSet.AssignHost(gNode);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, bool>(
                       commentSystem => commentSystem.IsCommentedByAuthor(gNode, gAuthor, dimension),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #12
0
        public override GraphChangeStatus Like(CommentID commentId, int deltaLike, int deltaDislike)
        {
            var pair = HostSet.AssignHost(commentId.G_Volume);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, GraphChangeStatus>(
                       commentSystem => commentSystem.Like(commentId, deltaLike, deltaDislike),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #13
0
        public override GraphChangeStatus DeleteComment(CommentID commentId)
        {
            var pair = HostSet.AssignHost(commentId.G_Volume);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, GraphChangeStatus>(
                       commentSystem => commentSystem.DeleteComment(commentId),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #14
0
        public override GraphChangeStatus Update(CommentID ratingId, RatingValue value, string content, byte[] data)
        {
            var pair = HostSet.AssignHost(ratingId.G_Volume);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, GraphChangeStatus>(
                       commentSystem => commentSystem.Update(ratingId, value, content, data),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #15
0
        public override Comment Respond(GDID gAuthorNode, CommentID parent, string content, byte[] data)
        {
            var pair = HostSet.AssignHost(parent.G_Volume);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, Comment>(
                       commentSystem => commentSystem.Respond(gAuthorNode, parent, content, data),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #16
0
        public override IEnumerable <Comment> Fetch(CommentQuery query)
        {
            var pair = HostSet.AssignHost(query.G_TargetNode);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, IEnumerable <Comment> >(
                       commentSystem => commentSystem.Fetch(query),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #17
0
        public override IEnumerable <Complaint> FetchComplaints(CommentID commentId)
        {
            var pair = HostSet.AssignHost(commentId.G_Volume);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, IEnumerable <Complaint> >(
                       commentSystem => commentSystem.FetchComplaints(commentId),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #18
0
        public override Comment Create(GDID gAuthorNode, GDID gTargetNode, string dimension, string content, byte[] data,
                                       PublicationState publicationState, RatingValue rating = RatingValue.Undefined, DateTime?epoch = null)
        {
            var pair = HostSet.AssignHost(gTargetNode);

            return(Contracts.ServiceClientHub
                   .CallWithRetry <IGraphCommentSystemClient, Comment>(
                       commentSystem => commentSystem.Create(gAuthorNode, gTargetNode, dimension, content, data, publicationState, rating, epoch),
                       pair.Select(host => host.RegionPath)
                       ));
        }
コード例 #19
0
        protected override Task <int> Async_DoEnqueue <TTodo>(IEnumerable <TTodo> todos, HostSet hs, string svcName)
        {
            var hostPair = hs.AssignHost(new ShardKey(todos.First().SysShardingKey));

            return(App.GetServiceClientHub().CallWithRetryAsync <Contracts.ITodoQueueClient, int>
                   (
                       (client) => client.Async_Enqueue(todos.Select(t => new TodoFrame(t)).ToArray()).AsTaskReturning <int>(),
                       hostPair.Select(host => host.RegionPath),
                       svcName: svcName
                   ));
        }
コード例 #20
0
ファイル: ProcessManager.cs プロジェクト: saleyn/agni
        protected override int DoEnqueue <TTodo>(IEnumerable <TTodo> todos, HostSet hs, string svcName)
        {
            var hostPair = hs.AssignHost(todos.First().SysShardingKey);

            return(Contracts.ServiceClientHub.CallWithRetry <Contracts.ITodoQueueClient, int>
                   (
                       (client) => client.Enqueue(todos.Select(t => new TodoFrame(t)).ToArray()),
                       hostPair.Select(host => host.RegionPath),
                       svcName: svcName
                   ));
        }
コード例 #21
0
        private void send(params SocialTrendingGauge[] data)
        {
            if (data == null || data.Length == 0)
            {
                return;
            }

            var hostPair = HostSet.AssignHost(App.TimeSource.UTCNow.Ticks);

            ServiceClientHub.CallWithRetry <ITrendingSystemClient>
            (
                cl => cl.Send(data),
                hostPair.Select(host => host.RegionPath)
            );
        }
コード例 #22
0
ファイル: GraphNodeManager.cs プロジェクト: saleyn/agni
        public override GraphChangeStatus RemoveNode(GDID gNode)
        {
            var pair = HostSet.AssignHost(gNode);

            return(Contracts.ServiceClientHub.CallWithRetry <IGraphNodeSystemClient, GraphChangeStatus>(nodeSystem => nodeSystem.RemoveNode(gNode), pair.Select(host => host.RegionPath)));
        }