John Fang created STORM-1582:
--------------------------------

             Summary: 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)

Reply via email to