-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data library async implementation #402
base: master
Are you sure you want to change the base?
Conversation
9351ce6
to
9da6486
Compare
Will you let us know when it's ready to review? |
@AsafMah |
data/src/main/java/com/microsoft/azure/kusto/data/auth/CloudInfo.java
Outdated
Show resolved
Hide resolved
I have a question about the approach for managing shared resources, particularly regarding concurrency and synchronization. Were you guys considering any specific strategies or patterns to handle concurrency in an async context? For instance, as async workflows will likely involve multiple tasks accessing and updating shared resources concurrently, I’m wondering if the locking approach will be adapted or if there's an intention to remove the locks in favor of another solution, (perhaps using atomic non-blocking operations, reactive patterns, etc.) in order to ensure that async tasks can safely read/write shared resources without blocking each other. |
@georgebanasios we encountered the same issues, and currently are still looking for a good solution. Eliminating locks whenever possible is usually an advantage either way. As far as I could find, there is no standard async-supporting lock, you might be able to simulate it with a task that periodically checks it. |
@
@georgebanasios: Thank you for your contribution, we too thought about the solution you did here, but we think its better to make sure the fetch is only called once. We conversed about it, i found this article interesting : |
@ohadbitt Thanks for the suggestion! Just to clarify, are you referring specifically to the fetch operations related to resource management (i.e.., ingestion resources, identity token)? |
Yes I'm referring to any result we used to take once (or once every .. ) |
b57e4c9
to
3e48f65
Compare
data/src/main/java/com/microsoft/azure/kusto/data/auth/CloudInfo.java
Outdated
Show resolved
Hide resolved
data/src/main/java/com/microsoft/azure/kusto/data/auth/CloudInfo.java
Outdated
Show resolved
Hide resolved
data/src/main/java/com/microsoft/azure/kusto/data/auth/endpoints/KustoTrustedEndpoints.java
Outdated
Show resolved
Hide resolved
data/src/main/java/com/microsoft/azure/kusto/data/auth/HttpClientWrapper.java
Outdated
Show resolved
Hide resolved
data/src/main/java/com/microsoft/azure/kusto/data/BaseClient.java
Outdated
Show resolved
Hide resolved
data/src/main/java/com/microsoft/azure/kusto/data/ClientImpl.java
Outdated
Show resolved
Hide resolved
data/src/main/java/com/microsoft/azure/kusto/data/ClientImpl.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still trying to remove most of the flatMaps where its not async call :)
- it seems to me to be a big deal but maybe im just new to reactive
data/src/main/java/com/microsoft/azure/kusto/data/ExponentialRetry.java
Outdated
Show resolved
Hide resolved
data/src/main/java/com/microsoft/azure/kusto/data/instrumentation/MonitoredActivity.java
Outdated
Show resolved
Hide resolved
354ef47
to
7adfb4d
Compare
No, you are right. I managed to remove almost all where there is not an async call. The ones left are on BaseClient (for the async parsing response), and on ClientImpl (for the http calls). I'll look into it if any remaining can be removed. |
data/src/main/java/com/microsoft/azure/kusto/data/auth/CloudDependentTokenProviderBase.java
Show resolved
Hide resolved
data/src/main/java/com/microsoft/azure/kusto/data/ClientImpl.java
Outdated
Show resolved
Hide resolved
data/src/main/java/com/microsoft/azure/kusto/data/ClientImpl.java
Outdated
Show resolved
Hide resolved
cfaca05
to
d60bedc
Compare
data/src/main/java/com/microsoft/azure/kusto/data/ExponentialRetry.java
Outdated
Show resolved
Hide resolved
fac2ebd
to
269a1db
Compare
Approved but please do add the "throws " to the async API as well |
Added
Changed