-
Notifications
You must be signed in to change notification settings - Fork 595
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
Proposal: Full async channel interface (IModel) #970
Comments
This is looking pretty good i.m.o. Here's an additional suggestion from me: public interface IChannelHandler
{
ValueTask OnFlowControl(IChannel channel, bool active);
ValueTask OnPublicAckReceived(IChannel channel);
...
} That way it's easy to override whatever logic to take care of in a class (logging, waiting for publish confirms etc.) and then register it with the channel interface The channel can maintain those handlers in a list and execute them (in parallel if needed) as events happen. That way those implementing the handlers can also do things asynchronously with minimal effort and the channel code would be free of all the async event workarounds we currently have. Logging and all sorts of instrumentation or special logic can then be added to augment the channel interface, especially if the handlers can have a reference to the Channel objects themselves and access other things. Similar things could be done for Connections to augment them in some way if applicable. |
I think we should consider if we want to continue with using interfaces as the public API. They make evolving the API in a non-breaking way difficult, unless we can be sure of support for default interface members in all targeted frameworks. |
I think all options should be considered. What would make sense in your mind? Do you mean mostly for the core functionality or also for other extensibility? Looking at comparable things in .NET Core I find it's mostly extensibility such as handlers and eventing becomes interface based but Core functionality is more rigid. |
I'm thinking that, by default, we should just use regular classes to provide functionality, and only in extensibility scenarios where we explicitly expect users of the library to provide their own implementations should we provide an interface or abstract class as a base. In addition, unless we can count on the use of default interface members to be able to version interfaces in a non-breaking way, we should opt for abstract classes in any extensibility scenarios. |
I do like the extensibility idea, but I don't see a lot of benefits compared to events.
What benefits do you see in this approach?
Absolutely agree with this. |
Updated initial post with removed methods and reason. (Also I'm working on making them nullable aware) Prerequisites: |
Any reason not to move this from |
Abstract classes/virtual methods would also work, and could provide the option of only overriding the methods one is interested in. The reason I don't like events is because they are error prone, require bookkeeping and are not straightforward/ugly when you want them to be async. However, it should be easy for users to create a handler that exposed the OnXXX methods as events if that's needed, without forcing them into to specific custom AsyncEvent delegates. A basic handler that does that would also be easy to ship with the library. I'm not really worried about performance of virtual dispatch for these scenarios, since events aren't much cheaper anyways and they are also harder to run in parallel. |
yes. it forces this library to provide the implementation in that class. For me it is a step in the wrong direction to go from interface to class. You dont have any benifit from using a class. If you have a breaking change it will break the class the same way the interface breaks. If you want to reduce the impact of breaking changes the interface(s) need to be smaller and more focused on a single thing. regarding IChannelHandler: my personal opinion is that if you want to have a handler interface instead of event pattern you should use IObservable instead of rolling your own interface. IObservable is an interface designed for events with existing tooling around it. |
This is pretty much most extensibility works for example in ASP.NET Core. |
There is a performance benefit from using classes vs interfaces (Inlining & non virtual method calls).
I see the point of interface usage in other areas, but I don't see it for this type. Could you elaborate a bit more about this @JanEggers ?
I think from the implementation point of view you kind of have to do the same, e.g you got to store them somewhere (List vs eventA, eventB) and you got to invoke them (non task returning ones are simpler with events, task returning ones are basically implemented the same (iterate over all and call them). What I question is, I think the number of use cases for the currently exposed events are too low to warrant the ChannelHandler class. If we would expose more events and possibly group them for different consumer groups (e.g. one for acks, one for managing the connection, one for exception handling, ...) I think the handler approach would make more sense, but for now, I'm not sure whether it complicates things more than it helps... 🤔 |
I dont know any more facts that benifit interfaces over classes. Maybe mocking is easier. It just my opinion that interfaces are the way to express public api's. Microsoft even goes one step further an provides ***.abstractions.dll that mostly provide Interfaces and utility classes that build uppon these interfaces. And again as we both agree it does not make much of a difference in case there is a breaking changes. Also if the is a measurable performance benifit in using a class here im all for it as performance is more important for me. |
Moving to 8.0 so that we can ship a 7.0 with a smaller set of breaking API changes if necessary. |
updated initial post with ChannelExtensions and moved 2 methods from the "interface" to the extensions. |
Hmm valid point, maybe users use our interfaces for mocking, let me think about this.
Yes, but they're abstractions built to mask the different implementation, which we will not have. Our library will only have one channel implementation. |
@stebet |
The ability to be mockable is something we need to think about. In my opinion, instead of only exposing the interface, I rather expose the class, but also let it implement an Interface that matches the same public methods the class has. So customer could decide whether they want to use the interface to enable interface mocking or whether they want to use the class itself directly. Question is would customer mock the "IChannel" or would you add mocking a layer further up in your application? |
updated initial post with
|
I assume this is purely informational right? I.e. to let the user know if he's interested that the flow control kicked in or not?
Is this superseded by NackMessageAsync? Or is there a reason to keep it? Don't know who to tag but @michaelklishin ? |
|
emphasis on "can". Question is what do we want to expose from our library. If basic.nack does all that basic.rejct does plus more, I'd just simply expose a "RejectMessageAsync" method and not let the users figure out whether to use "basic.nack" or "basic.reject" |
// deprecated according to comments
event EventHandler<EventArgs> BasicRecoverOk;
void BasicRecover(bool requeue);
void BasicRecoverAsync(bool requeue); @michaelklishin Are these still needed or can these be removed? |
When I've started implementing it, I've detected that only an interface works because of the auto reconnection feature. This is currently implemented in a way that the In my opinion, I'd expose the classes behind as well, so people wanting to use the real class can do so. |
Will there be a |
Hello. I decided to fork the repository and add |
Related to: * #1345 * #1308 * #970 * #843 Implement QueueDeleteAsync, ExchangeDeclareAsync and ExchangeDeleteAsync. Refactoring to come. Fix public API Move rpc continuations to their own files Add continuation timeouts to new AsyncRpcContinuations classes. Add ExchangeBindAsync to interface Fixup compilation after rebase Add QueueDeleteOk to API Add ExchangeBindAsync Add `[Collection("IntegrationFixture")]` to test class that needs it, move test to an integration fixture class dotnet format fix Add exchange-exchange binding to test Add QueueBindAsync and add to tests. Add ExchangeUnbindAsync method Add BasicRejectAsync Add BasicCancelAsync Add BasicConsumeAsync Added BasicAckAsync and BasicQosAsync
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory.
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it.
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration Consumer dispatcher shutdown fixes, test suite fixes to use ManualResetEventSlim instead of Monitor
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration Consumer dispatcher shutdown fixes, test suite fixes to use ManualResetEventSlim instead of Monitor
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration Consumer dispatcher shutdown fixes, test suite fixes to use ManualResetEventSlim instead of Monitor
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration Consumer dispatcher shutdown fixes, test suite fixes to use ManualResetEventSlim instead of Monitor
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration Consumer dispatcher shutdown fixes, test suite fixes to use ManualResetEventSlim instead of Monitor
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration Consumer dispatcher shutdown fixes, test suite fixes to use ManualResetEventSlim instead of Monitor
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync * Only increase ThreadPool count for Integration tests
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync * Only increase ThreadPool count for Integration tests
This will be completed by #1347 |
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync * Only increase ThreadPool count for Integration tests * There is no need to expose ClientMemory / RentedMemory
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync * Only increase ThreadPool count for Integration tests * There is no need to expose ClientMemory / RentedMemory * Replace IList with IEnumerable in the API.
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync * Only increase ThreadPool count for Integration tests * There is no need to expose ClientMemory / RentedMemory * Replace IList with IEnumerable in the API.
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync * Only increase ThreadPool count for Integration tests * There is no need to expose ClientMemory / RentedMemory * Replace IList with IEnumerable in the API.
Related to: * #1345 * #1308 * #970 * #843 Separate out Unit, Integration and Parallel Integration tests * Creates dedicated test projects for parallel test execution (AsyncIntegration / Integration.csproj) and sequential (SequentialIntegration.csproj). * Ensures that the ThreadPool is set with enough threads. * Ensures that all test connections have their client provided name set. * Fix SequentialTests that require a unique connection name. * Shorten up test names used for connection client provided names * Ensure all async tests are in the AsyncIntegration project. * Convert MassPublish to async/await with multiple publishing connections. * Add MaxParallelThreads in a csproj comment in case we want to try that out * Wait longer when IsRunningInCI * Introduce the RentedMemory struct to encapsulate a rented byte array and its associated ReadOnlyMemory. * Add CreateChannelAsync and modify AsyncIntegration tests to use it. * Add CreateConnectionAsync * Use CreateConnectionAsync in AsyncIntegration * Change the test suite fixes to use ManualResetEventSlim instead of Monitor * Misc refactor to newer language features * SocketFrameHandler CloseAsync * Only increase ThreadPool count for Integration tests * There is no need to expose ClientMemory / RentedMemory * Replace IList with IEnumerable in the API.
I've drafted a proposal for a new IModel interface that I tried to keep as slim as possible while changing everything relevant to Async.
This proposal is in no way finalized and should serve as a discussion base. (I'll update the proposal accordingly)
Please also verify the naming of the members and methods, I think with the breaking change that we do anyway, we should make sure the new names are exactly what we want.
A few things to highlight:
Prerequisites:
As a reference, here's the current interface.
The WaitForConfirms methods I plan to replace with a new class that can be wrapped around IChannel, so customer can decide if they want to use our basic implementation or build something on their own.
FYI removed methods:
The text was updated successfully, but these errors were encountered: