public WaitForEvent(IEventReader reader, float timeout = -1) { this.timeout = timeout; connection = reader.Subscribe(() => { connection.DisconnectSafe(); ready = true; connection = null; }); if (ready) { connection.Dispose(); } }