enable some asynchronous logging (revised)#49
enable some asynchronous logging (revised)#49cosmo0920 wants to merge 20 commits intofluent:masterfrom
Conversation
There was a problem hiding this comment.
I'm not sure that this method worthiness, for now....
|
Why does this feature make no progress anymore? |
|
This feature is implemented in Fluency. |
|
@cosmo0920 Oh really sorry, I failed to notice the notifications of this project. Let me see the changes. |
|
|
||
| public FluentLoggerFactory() { | ||
| loggers = new WeakHashMap<FluentLogger, String>(); | ||
| loggers = Collections.synchronizedMap(new WeakHashMap<FluentLogger, String>()); |
There was a problem hiding this comment.
This change doesn't seem to be related to asynchronous logging.
|
@cosmo0920 @mxk1235 Thanks for the PRs! I left some comments. Also, it needs unit tests in principle. BTW, as I commented earlier, AsyncRawSocketSender creates a thread for each invoking |
|
Thanks for your review! I'll try to resolve issues which are pointed out. |
f63cc3f to
7cef979
Compare
|
I fixed some test failures at 969b88d. Could you try |
… wrapper around RawSocketSender
… wrapper around RawSocketSender
containsKey -> containsValue
2d6c3ea to
10d57db
Compare
|
Rebased! |
|
|
||
| import java.lang.reflect.Constructor; | ||
| import java.lang.reflect.InvocationTargetException; | ||
| import java.util.Collections; |
|
@cosmo0920 Thanks! I left some comments on the diff. Especially, https://github.com/fluent/fluent-logger-java/pull/49/files#r61833474 is an issue, I think. BTW, will you actually use AsyncRawSocketSender? If so, what do you think about creating an EmitRunnable for each |
* Added normal cases for now.
10d57db to
7392010
Compare
No, I won't.
I've added this one in javadoc comment. |
| return this.isConnected() || reconnector.enableReconnection(System.currentTimeMillis()); | ||
| try { | ||
| Future<Boolean> result = senderTask.submit(new EmitRunnable(tag, data, sender, timestamp)); | ||
| return result.get(); |
There was a problem hiding this comment.
Unfortunately, Future#get will wait the result here. So this method doesn't work asynchronously...
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html#get--
|
@cosmo0920 Sorry for late reply again. Could you check this comment? 1bf11d7#r65201214 |
1bf11d7 to
046b798
Compare
Revised #30.
And I modified
setErrorHandler/removeErrorHandlerinAsyncRawSocketSender.Should I add tests for
AsyncRawSocketSender?