List of usage examples for java.util.concurrent ScheduledExecutorService execute
void execute(Runnable command);
From source file:org.ros.internal.transport.OutgoingMessageQueue.java
public OutgoingMessageQueue(MessageSerializer<MessageType> serializer, ScheduledExecutorService executorService) { this.serializer = serializer; messages = new CircularBlockingQueue<MessageType>(MESSAGE_BUFFER_CAPACITY); channelGroup = new DefaultChannelGroup(); writer = new Writer(); latchMode = false;/*from w ww .j a v a 2 s. c om*/ executorService.execute(writer); }
From source file:playmidi.task.MidiPlayTaskTest.java
/** * Test of run method, of class MidiPlayTask. *//*from w ww . j ava 2 s .c o m*/ @Test public void testRun() throws IOException, FileNotFoundException, MidiUnavailableException, InvalidMidiDataException, InterruptedException { System.out.println("run"); ScheduledExecutorService playerRunner = Executors.newSingleThreadScheduledExecutor(); try (MidiPlayTask instance = new MidiPlayTask(name, count)) { playerRunner.execute(instance); Thread.sleep(20000); instance.stop(); } }
From source file:sk.baka.webvm.analyzer.utils.NotificationDelivery.java
@Override protected void started(ScheduledExecutorService executor) { executor.execute(new Notificator()); }