Azure-Samples / azure-cosmos-java-sql-api-samples

Sample code for Azure Cosmos DB Java SDK for SQL API
MIT License
38 stars 70 forks source link

Added publishOn operator and updated comments #60

Closed kushagraThapar closed 1 year ago

kushagraThapar commented 1 year ago

Based on testing, subscribeOn() won't help here, because internally SDK changes the threads to I/O, which then finally exposes the I/O thread back to the user. It is better to call publishOn() which will make sure whatever SDK does, it will always expose Reactor scheduler's thread to the end user, making it safe to not expose I/O threads.