[ https://issues.apache.org/jira/browse/STORM-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15172331#comment-15172331 ]
Jungtaek Lim commented on STORM-1582: ------------------------------------- Seems like we're porting clojure codes to java codes with keeping styles. Actually I didn't see any codes like asyncLoop in other projects written in Java. Eventually whole codebase will be refactored to Java style. > asyncLoop will calls repeatedly when the return type of call only is Long > ------------------------------------------------------------------------- > > Key: STORM-1582 > URL: https://issues.apache.org/jira/browse/STORM-1582 > Project: Apache Storm > Issue Type: Question > Reporter: John Fang > > It can repeatedly invoke fn.call when only the return type of call is Long. I > think it maybe a bug. > public static SmartThread asyncLoop(final Callable afn, > boolean isDaemon, final Thread.UncaughtExceptionHandler eh, > int priority, final boolean isFactory, boolean startImmediately, > String threadName) { > SmartThread thread = new SmartThread(new Runnable() { > public void run() { > Object s; > try { > Callable fn = isFactory ? (Callable) afn.call() : afn; > while ((s = fn.call()) instanceof Long) { //////???????? > Time.sleepSecs((Long) s); > } > } -- This message was sent by Atlassian JIRA (v6.3.4#6332)