Comments (1)
I was able to spend more time on this along with other engineers, and we think we finally found an explanation for the above differences:
When using the AdvancedBusExtensions overload that uses the delegate, a Task is declared as return type but there’s nothing really forcing the implementation to be async. You can have a delegate that does no async, and still not have compilation errors (just a self explanatory warning as in the screenshot):
![Screenshot 2024-02-08 at 16 03 18](https://private-user-images.githubusercontent.com/10221348/303388066-df5056c2-3fa9-41f6-aac1-2a99dccf47a4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkyMzY1NDcsIm5iZiI6MTcxOTIzNjI0NywicGF0aCI6Ii8xMDIyMTM0OC8zMDMzODgwNjYtZGY1MDU2YzItM2ZhOS00MWY2LWFhYzEtMmE5OWRjY2Y0N2E0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI0VDEzMzcyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYwYTIxZWNlYTRlMTg0YzIyMTIxMGMxYjc1MzM2OGNhMDhlZGJjYTk2MDFiMjBhNGI3MTIwOWM1MmUyZDkxNTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.s1W1odD2IRFdwUP7ddkK9PPXsGji0FApcDBtza8RVhk)
So, in order for the task to be actually returned, all the (blocking) code which is included in your consumer has to execute.
If what you’re doing there is time-consuming, then you’ll face significant issues, due to single messages “blocking” the ones already prefecthed.
The other - very similar - overloaded method that I’ve used in one of my test in the Gist has an Action<ReadOnlyMemory<byte>, MessageProperties, MessageReceivedInfo>
parameter that describes the handler, and that gets internally wrapped into a task! This is the reason why, even if the consumer does purely blocking stuff, that is still offloaded to a worker thread and we see concurrent consuming.
Having this behavior clear in mind, I'm happy closing the issue. ✅
With that said, I personally think it would be worth capturing this subtle difference somehow on the extension class, using slightly different signature names and/or improving the documentation.
from easynetq.
Related Issues (20)
- upgrade dependency packages HOT 1
- EasyNetQ.Serialization.NewtonsoftJson.dll is automatically detected, but EasyNetQ.Serialization.SystemTextJson.dll is not HOT 2
- Connection doesn't seem to recover after specific BrokerUnreachableException HOT 2
- AlreadyClosedException HOT 1
- Enable CA1852 diagnostic rule HOT 1
- How do I create a multi tenant base queue, pls need some help
- How to work with correlationId in EasyNetQ HOT 3
- No 7.8.1 version in nuget.org HOT 3
- [Question] How to access IServiceResolver in 8.0.0 HOT 1
- EasyNetQ + Google.Protobuf HOT 1
- Only include STJ for net standard 2.0
- Package should be using a license expression
- Pubsub.PublishAsync inconsistent timeout behaviour when server is unreacheable
- Replace proprietary logging with Microsoft logging abstractions
- Replace DI container abstraction and packages with Microsoft abstractions
- System.OperationCanceledException HOT 1
- Cannot connect to RMQ after update to 7.8.0. HOT 9
- Central package management
- dispose cannot close the connection to rabbitMq HOT 1
- RabbitMQ.Client 7.0 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easynetq.