You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@zeldigas , thanks for the feedback. I think the idea for having the IO dispatcher fetch messages is that there is in fact a lot of IO work being done.
As you are using aws sdk v2 and message processor has suspend modifier I don't see the reason for not using Dispatchers.Default.
I don't fully understand, how this relates to the dispatcher, but I would love to learn more.
IO dispatcher in coroutines should be used in cases when you expect a blocking to happen (and as it name suggests there is expectation that blocking would be done while dealing with I/O operations if you use regular Socket impl, not NIO).
But the thing is that in your code you are using aws sdk v2 (https://github.com/SeekerWing/aws-sqs-consumer/blob/master/src/main/kotlin/org/seekerwing/aws/sqsconsumer/model/Queue.kt#L10) that is non-blocking, so you can use regular dispatcher (Distpachers.Default), because it is not supposed to block on socker read/write.
What is the reason of using IO dispatcher for launching message fetchers and consumers?
https://github.com/SeekerWing/aws-sqs-consumer/blob/master/src/main/kotlin/org/seekerwing/aws/sqsconsumer/SqsQueueConsumer.kt#L19
As you are using aws sdk v2 and message processor has
suspend
modifier I don't see the reason for not usingDispatchers.Default
.The text was updated successfully, but these errors were encountered: