public Turnstile(DurableConnection <Req, Resp> connection) { Condition.Requires(connection, "connection").IsNotNull(); _connection = connection; _connection.OnDisconnected += OnDisconnected; _queue = new RequestQueue(connection.Scheduler); }
// Does not take ownership of `scheduler`: DurableConnection.Dispose() won't call Scheduler.Dispose(). public DurableConnection(IConnector <In, Out> connector, Scheduler scheduler) { Condition.Requires(connector, "connector").IsNotNull(); Condition.Requires(scheduler, "scheduler").IsNotNull(); _connector = connector; _scheduler = scheduler; _requestQueue = new RequestQueue(scheduler); }