You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2017/09/13 12:04:48 UTC

[2/2] qpid-proton-j git commit: PROTON-1583: add some javadoc to clarify the use and behaviour of the tick method

PROTON-1583: add some javadoc to clarify the use and behaviour of the tick method


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/commit/f52166eb
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/tree/f52166eb
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton-j/diff/f52166eb

Branch: refs/heads/master
Commit: f52166eb35f0d6952bea09716bf9dc6a9d3b7b1b
Parents: 158649c
Author: Robbie Gemmell <ro...@apache.org>
Authored: Wed Sep 13 13:02:47 2017 +0100
Committer: Robbie Gemmell <ro...@apache.org>
Committed: Wed Sep 13 13:02:47 2017 +0100

----------------------------------------------------------------------
 .../org/apache/qpid/proton/engine/Transport.java | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton-j/blob/f52166eb/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java
index b4864e5..35b2d50 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java
@@ -274,7 +274,24 @@ public interface Transport extends Endpoint
      */
     int getRemoteIdleTimeout();
 
-    long tick(long now);
+    /**
+     * Prompt the transport to perform work such as idle-timeout/heartbeat handling, and return an
+     * absolute deadline in milliseconds that tick must again be called by/at, based on the provided
+     * current time in milliseconds, to ensure the periodic work is carried out as necessary.
+     *
+     * A returned deadline of 0 indicates there is no periodic work necessitating tick be called, e.g.
+     * because neither peer has defined an idle-timeout value.
+     *
+     * The provided milliseconds time values can be from {@link System#currentTimeMillis()} or derived
+     * from {@link System#nanoTime()}, noting that for the later in particular that the returned
+     * deadline could be a different sign than the given time, and (if non-zero) the returned
+     * deadline should have the current time originally provided subtracted from it in order to
+     * establish a relative time delay to the next deadline.
+     *
+     * @param nowMillis the current time in milliseconds
+     * @return the absolute deadline in milliseconds to next call tick by/at, or 0 if there is none.
+     */
+    long tick(long nowMillis);
 
     long getFramesInput();
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org