public ITransportPeer route(params RiggedTransportPeer[] peers) { var assignment = new OrderedAssignment("foo://1".ToUri(), peers); var task = assignment.SelectOwner(); task.Wait(); return task.Result; }
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(); }
public Task<ITransportPeer> SelectOwner(IEnumerable<ITransportPeer> peers) { var ordered = peers.OrderBy(x => x.ControlChannel.ToString()); var completion = new OrderedAssignment(Uri, ordered); return completion.SelectOwner(); }