コード例 #1
0
        public ITransportPeer route(params RiggedTransportPeer[] peers)
        {
            var assignment = new OrderedAssignment("foo://1".ToUri(), peers);
            var task = assignment.SelectOwner();

            task.Wait();

            return task.Result;
        }
コード例 #2
0
        public Task<ITransportPeer> SelectOwner(IEnumerable<ITransportPeer> peers)
        {
            var ordered = _preferredNodes.Select(x => peers.FirstOrDefault(_ => _.NodeId == x))
                .Where(x => x != null);

            StoryTellerAssert.Fail(!ordered.Any(), "No preferred nodes established for this test node");

            var assignment = new OrderedAssignment(Subject, ordered);

            return assignment.SelectOwner();
        }
コード例 #3
0
        public Task<ITransportPeer> SelectOwner(IEnumerable<ITransportPeer> peers)
        {
            var ordered = peers.OrderBy(x => x.ControlChannel.ToString());
            var completion = new OrderedAssignment(Uri, ordered);

            return completion.SelectOwner();
        }