public void Dispose()
        {
            if (isDispose)
            {
                return;
            }

            isDispose = true;
            _receiver.CloseAsync().GetAwaiter().GetResult();
            _receiver = null;
        }
        public async ValueTask DisposeAsync()
        {
            if (isDispose)
            {
                return;
            }

            isDispose = true;
            await _receiver.CloseAsync();

            _receiver = null;
        }
 public InMemoryMessageSubscriber(InMemoryQueue queue, IMessageSerializer serializer)
 {
     _receiver   = new InMemoryTransportReceiver(queue);
     _serializer = serializer;
 }