-
Notifications
You must be signed in to change notification settings - Fork 42
Implement IDisposable method to Producer and Consumer Class #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @stebet
See all the tests we did. But we (I and @MarcialRosales) don't understand what going on there. The problem seems related to the change we did to add the Wondering if we should remove Thank you p.s. private async ValueTask<TOut> Request<TIn, TOut>(Func<uint, TIn> request, int timeout = 10000) where TIn : struct, ICommand where TOut : struct, ICommand
{
var corr = NextCorrelationId();
var tcs = PooledTaskSource<TOut>.Rent();
requests.TryAdd(corr, tcs);
await Publish(request(corr));
using (CancellationTokenSource cts = new CancellationTokenSource(timeout))
{
/// Add await here???
await using ( |
Add Close/0 method as in Java and Go. Implement IDisposable interface. Dispose internally calls Close/0. The Close/0 method removes the Producer/Consumer from the server list and Close the TCP connection if there are no producers and consumers Co-Authored-By: Ivan Maximov <sungam3r@yandex.ru>
9c774e9
to
ada5666
Compare
per conversation with @kjnilsson |
Implement
IDisposble
method forProducer
andConsumer
class.That's the idea:
user can also call directly
Close()
to remove the producer from the server ( not mandatory btw)for
Consumer
:user can also call directly
Close()
to remove the consumer from the server ( not mandatory btw)