Azure / Azure/azure-sdk-for-java

[FEATURE REQ] Allow configuration of Reactive Scheduler on SDK or Client level

Aperta
#48,827 1 commento 0 reazioni 2 assegnatari Rivendicata da @alzimmermsft Vedi su GitHub
common customer-reported feature-request needs-team-attention
Lingua principale
Java
Stelle
2.6k
Fork
2.2k
Merge medio
2g 2h
PR unite (30g)
205

Descrizione

**Is your feature request related to a problem? Please describe.**

My application has a dedicated thread pool for IO operations that I want to use for azure-sdk async clients (namely eventhubs and blob storage ones) as a `Scheduler` instead of `Schedulers.boundedElastic()` but I couldn't find any way to set it across the sdk, or client specific. EventHubClientBuilder has a `EventHubClientBuilder scheduler(Scheduler scheduler)` method but it's not `public`. `BlobServiceClientBuilder` doesn't have such method.

**Describe the solution you'd like**
Some way to configure Scheduler for all SDK or client basis. Such as

```
EventHubClientBuilder()
.connectionString(...)
.scheduler(customScheduler) // method exist but package private
.buildAsyncProducerClient()

BlobServiceClientBuilder()
.scheduler(customScheduler) // method doesn't exist
.buildAsyncClient()
```

**Describe alternatives you've considered**
I'm currently using `Mono publishOn(Scheduler scheduler)` method but it's kind of error prone. Also I'm not sure that's enough to avoid creation of the `Schedulers.boundedElastic()` pool for consumer clients. Here's how my code looks now:

```
eventHubProducerClient.send(data, sendOptions)
.publishOn(customScheduler)
.subscribe(...)
```

**Additional context**
N/A

**Information Checklist**
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [X] Description Added
- [X] Expected solution specified

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.