@Test public void testSharesFunctionWhenMultiplePostProcessors() throws Exception { final IncrementingCallable incrementingCallable = new IncrementingCallable(); final List<Integer> ints = new CopyOnWriteArrayList<Integer>(); final List<String> strings = new CopyOnWriteArrayList<String>(); entity.subscriptions().subscribe(entity, SENSOR_INT, new SensorEventListener<Integer>() { @Override public void onEvent(SensorEvent<Integer> event) { ints.add(event.getValue()); }}); entity.subscriptions().subscribe(entity, SENSOR_STRING, new SensorEventListener<String>() { @Override public void onEvent(SensorEvent<String> event) { strings.add(event.getValue()); }}); feed = FunctionFeed.builder() .entity(entity) .poll(new FunctionPollConfig<Integer, Integer>(SENSOR_INT) .period(10) .callable(incrementingCallable)) .poll(new FunctionPollConfig<Integer, String>(SENSOR_STRING) .period(10) .callable(incrementingCallable) .onSuccess(new ToStringFunction())) .build(); Asserts.succeedsEventually(new Runnable() { @Override public void run() { assertEquals(ints.subList(0, 2), ImmutableList.of(0, 1)); assertTrue(strings.size()>=2, "wrong strings list: "+strings); assertEquals(strings.subList(0, 2), ImmutableList.of("0", "1"), "wrong strings list: "+strings); }}); }
public static Builder builder() { return new Builder(); }
FunctionFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } }
FunctionFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } FunctionFeed(); protected  FunctionFeed(Builder builder); }
FunctionFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } FunctionFeed(); protected  FunctionFeed(Builder builder); static Builder builder(); static Builder builder(String uniqueTag); }
FunctionFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } FunctionFeed(); protected  FunctionFeed(Builder builder); static Builder builder(); static Builder builder(String uniqueTag); @SuppressWarnings("serial")
    static final ConfigKey<SetMultimap<FunctionPollIdentifier, FunctionPollConfig<?,?>>> POLLS; }