input.transferTo( output );
@Override public void run() { synchronized (listeners) { Input<TransactionApplicationEvents, RuntimeException> input = Inputs.iterable( Collections.singleton( transactionDomain ) ); for (Output<TransactionApplicationEvents, ? extends Throwable> listener : listeners) { try { input.transferTo( listener ); } catch (Throwable e) { logger.warn( "Could not notify event listener", e ); } } } } } );
public void reindex( EntityStore store ) { store.entityStates( module ).transferTo( this ); reindexState(); }
@Test public void testIOString() throws Exception { StringBuilder sb = new StringBuilder(); iterable( byteCollection() ).transferTo( map( valueSerialization.serialize(), text( sb ) ) ); String output = sb.toString(); List<Byte> list = new ArrayList<Byte>(); text( output ).transferTo( map( valueSerialization.deserialize( Byte.class ), collection( list ) ) ); assertEquals( byteCollection(), list ); }
public void start() { if (!started) { started = true; // Get events since last check upToSpeed = true; // Pretend that we are up to speed from now on trackerOutput = output(); try { source.transactionsAfter( configuration.get().lastOffset().get(), Long.MAX_VALUE ).transferTo( trackerOutput ); } catch (Throwable receiverThrowableType) { upToSpeed = false; } stream.registerListener( trackerOutput ); } }
source.transactionsAfter( configuration.get().lastOffset().get(), Long.MAX_VALUE ).transferTo( trackerOutput ); } catch (Throwable e)
@Override public synchronized void run() { // TODO This should optionally use a CircuitBreaker if (started && configuration.get().enabled().get()) { Transforms.Counter counter = new Transforms.Counter(); try { long currentOffset = configuration.get().lastOffset().get(); source.events( currentOffset, Long.MAX_VALUE ).transferTo( Transforms.map( counter, output ) ); // Save new offset, to be used in next round configuration.get().lastOffset().set( currentOffset+counter.count() ); configuration.save(); } catch (Throwable throwable) { logger.warn( "Event handling failed", throwable ); } } }
Inputs.iterable( Iterables.iterable( unitOfWorkDomainValue ) ).transferTo( eventOutput );