public void run() throws HandlerException { //Codes_SRS_IOTHUBREACTOR_34_003: [This function shall set the timeout of the reactor to 10 milliseconds.] this.reactor.setTimeout(10); this.reactor.start(); //Codes_SRS_IOTHUBREACTOR_34_004: [This function shall start the reactor and have it process indefinitely and stop the reactor when it finishes.] while(this.reactor.process()){} this.reactor.stop(); this.reactor.process(); this.reactor.free(); } }
/** * Main run function to pump Proton messages * @throws HandlerException If Protonj failed. */ public void run() throws HandlerException { this.reactor.setTimeout(REACTOR_TIMEOUT); this.reactor.start(); while(this.reactor.process()){} this.reactor.stop(); this.reactor.process(); this.reactor.free(); } }
@Override public void run() { if (TRACE_LOGGER.isWarnEnabled()) { TRACE_LOGGER.warn(String.format(Locale.US, "messagingFactory[%s], hostName[%s], message[%s]", getClientId(), getHostName(), "Processing all pending tasks and closing old reactor.")); } try { rctr.stop(); rctr.process(); } catch (HandlerException e) { if (TRACE_LOGGER.isWarnEnabled()) { TRACE_LOGGER.warn(String.format(Locale.US, "messagingFactory[%s], hostName[%s], error[%s]", getClientId(), getHostName(), ExceptionUtil.toStackTraceString(e, "scheduleCompletePendingTasks - exception occurred while processing events."))); } } finally { rctr.free(); } } }, MessagingFactory.this.getOperationTimeout().getSeconds(), TimeUnit.SECONDS);
break; continueProcessing = this.rctr.process();
if (!Thread.interrupted() && this.rctr.process()) { try { this.executor.execute(this);