예제 #1
0
파일: Odd.java 프로젝트: qneo/odd
  @Override
  public <A, B> Node<A, B> node(final BiConsumer<A, Consumer<B>> biconsumer) {
    validateArgs(biconsumer != null, "biconsumer cant be null.");

    BiConsumer<Exception, Consumer<B>> recovery = Utils.nopRecovery();
    Node<A, B> node =
        new qneo.odd.details.monothread.Node<A, B>(recovery, biconsumer, this, executor);
    nodes.put(node, new Config(String.valueOf(nodes.size())));
    return node;
  }
예제 #2
0
파일: Odd.java 프로젝트: qneo/odd
 @Override
 public <A, B> void config(final Node<A, B> node, Config config) {
   Validate.validateArgs(nodes.containsKey(node), "The node dont belong to this mesh.");
   nodes.put(node, config);
 }
예제 #3
0
파일: Odd.java 프로젝트: qneo/odd
 @Override
 public <A, B> Config config(final Node<A, B> node) {
   Validate.validateArgs(nodes.containsKey(node), "The node dont belong to this mesh.");
   return nodes.get(node);
 }
예제 #4
0
파일: Odd.java 프로젝트: qneo/odd
 @Override
 public <A, B> Node<A, B> node(final Function<A, B> function) {
   validateArgs(function != null, "function cant be null.");
   BiConsumer<A, Consumer<B>> adapter = Utils.adaptToBiConsumer(function);
   return node(adapter);
 }