Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The close(timeout) should work when called from a user caller thread or the internal sender thread.
  • In sender thread only close(0, TimeUnit.MILLISECONDS) should be called because:
    • close() should not be called because that will make producer block forever.
    • close(500, TimeUnit.MILLISECONDS) has the same effect as close(0, TimeUnit.MILLISECONDS) only except it will block for 500 milliseconds.
  • IMPORTANT, for the reason above, if a close() or close(timeout, TimeUnit) is called from sender thread (i.e. callback). An error message will be logged and close(0, TimeUnit.MILLISECONDS) will be called instead.
  • Because it is possible the close(timeout) is called for multiple times, it has to be idempotent.

...

If sender thread calls close(), it will block forever. So if a close() call is called from sender thread, an error message will be put in the log and sender thread will be blocked forever. This is to:

...

close(0) will be called instead.

Compatibility, Deprecation, and Migration Plan

...