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):
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)
- Connecting to multiple virtual hosts HOT 2
- i got one issue for lastes version Code: 500 InternalServerError' HOT 1
- Documentation improvment for service registration with System.Text.Json as default serializer. HOT 4
- TaskCanceledException thrown on Timeout HOT 1
- Consumer Error Strategy "cancelled" is called independent of the exception source HOT 1
- RobiniaDocs API Explorer
- ObjectDisposedException racing condition?
- Support OAuth2 HOT 3
- The-Advanced-API ->publishing non async with EasyNetQ.IMessage does not exist
- Subscriber can not be recovered after heartbeat missing error
- CRITICAL: The GitHub WIKI page is editable by any GitHub user HOT 3
- Dispose Consumer causing deadlock HOT 1
- Batch Publish HOT 3
- Add .NET Aspire component HOT 2
- Subscribe to third party topic exchange HOT 1
- Bus.Advanced.PublishAsync(...) does not serialize Dictionary<string, object> properly
- 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
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.