private void onStdOut(TtyConnection conn, int[] buffer) { conn.execute(() -> { conn.stdoutHandler().accept(buffer); }); if (processStdoutListener != null) { processStdoutListener.accept(buffer); } } }
private void onStdOut(TtyConnection conn, int[] buffer) { conn.execute(() -> { conn.stdoutHandler().accept(buffer); }); if (processStdoutListener != null) { processStdoutListener.accept(buffer); } } }
/** * Schedule delivery of pending events in the event queue. */ public void schedulePendingEvent() { TtyConnection conn; synchronized (this) { if (interaction == null) { throw new IllegalStateException("No interaction!"); } if (decoder.hasNext()) { conn = interaction.conn; } else { return; } } conn.execute(Readline.this::deliver); }
/** * Schedule delivery of pending events in the event queue. */ public void schedulePendingEvent() { TtyConnection conn; synchronized (this) { if (interaction == null) { throw new IllegalStateException("No interaction!"); } if (decoder.hasNext()) { conn = interaction.conn; } else { return; } } conn.execute(Readline.this::deliver); }
private void doneHandler(TtyConnection conn, Readline readline) { conn.setEventHandler(null); conn.execute(() -> read(conn, readline)); }
private void doneHandler(TtyConnection conn, Readline readline) { conn.setEventHandler(null); conn.execute(() -> read(conn, readline)); }
@Override public void accept(TtyConnection conn) { final Thread connThread = Thread.currentThread(); conn.execute(new Runnable() { @Override public void run() { Thread schedulerThread = Thread.currentThread(); try { assertThreading(connThread, schedulerThread); } catch (Exception e) { fail(e); } testComplete(); } }); } });
@Test public void testScheduleThread() throws Exception { server(conn -> { Thread connThread = Thread.currentThread(); conn.execute(() -> { Thread schedulerThread = Thread.currentThread(); try { assertThreading(connThread, schedulerThread); } catch (Exception e) { fail(e); } testComplete(); }); }); assertConnect(); await(); }
@Test public void testScheduleThread() throws Exception { server(conn -> { Thread connThread = Thread.currentThread(); conn.execute(() -> { Thread schedulerThread = Thread.currentThread(); try { assertThreading(connThread, schedulerThread); } catch (Exception e) { fail(e); } testComplete(); }); }); assertConnect(); await(); }