-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add asynchronous flush support #82
Conversation
0693e3d
to
864a93a
Compare
src/main/java/software/amazon/cloudwatchlogs/emf/sinks/AgentSink.java
Outdated
Show resolved
Hide resolved
src/main/java/software/amazon/cloudwatchlogs/emf/sinks/AgentSink.java
Outdated
Show resolved
Hide resolved
src/main/java/software/amazon/cloudwatchlogs/emf/sinks/ISink.java
Outdated
Show resolved
Hide resolved
9a934b4
to
f7533b8
Compare
SocketClientFactory clientFactory) { | ||
SocketClientFactory clientFactory, | ||
int asyncQueueDepth, | ||
Supplier<RetryStrategy> retryStrategy) { |
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.
👆Breaking change.
* @return a future that completes when the shutdown has completed successfully and all pending | ||
* messages have been sent to the destination. | ||
*/ | ||
CompletableFuture<Void> shutdown(); |
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.
👆Breaking change
f7533b8
to
8cd1bc8
Compare
e1e09a4
to
8cd1bc8
Compare
|
||
/** | ||
* The max number of messages to hold in memory in case of transient socket errors. The maximum | ||
* message size is 256 KB meaning the maximum size of this buffer would be 25,600 MB |
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.
25,600 KB?
Adds asynchronous flushing, automatic retries for transient socket errors, and graceful shutdown.
Design Notes / Other Considerations:
AgentSink
.CompletableFuture
. An alternative to this is providing an(long timeout, TimeUnit unit)
signature similar toawaitTermination
which would allow us to use that interface directly when shutting down the executor. However, this creates an awkward API that doesn't easily support composition with other tasks to run in parallel.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.