Closed stengvac closed 3 years ago
The honest answer is that it was written by people who were learning Java as they went and were not aware of sophisticated considerations such as you mention.
In any case, this client is now legacy and in maintenance mode. We will not be adding new features or making major changes. You can find the new Java Event Hubs client at https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/eventhubs/azure-messaging-eventhubs
Actual Behavior
Hello, I would like to ask why EventHubClient factory methods take ScheduledExecutorService as executor instead of ExecutorService/ThreadPoolExecutor. My understanding is, that app should if possible use single threaded ScheduledExecutorService and when sheduled task is invoked then use provided ExecutorService/ThreadPoolExecutor as worker for task. So only responsibility of ScheduledExecutorService is scheduling and not task execution. Only then can scheduler invoke tasks in desired time intervals (because is not executing tasks).
For backward compatibility ExecutorService.
Expected Behavior