Package org.akka.essentials.java.future.example.messages

Examples of org.akka.essentials.java.future.example.messages.Order


  @Override
  public void onReceive(Object message) throws Exception {
    if (message instanceof Integer) {
      Integer userId = (Integer) message;
      // ideally we will get list of orders for given user id
      Order order = new Order(Integer.valueOf(123), Float.valueOf(345),
          Integer.valueOf(5));
      getSender().tell(order);
    }
  }
View Full Code Here


      final Future<OrderHistory> aggResult = aggregate.map(
          new Mapper<Iterable<Object>, OrderHistory>() {
            public OrderHistory apply(Iterable<Object> coll) {
              final Iterator<Object> it = coll.iterator();
              final Order order = (Order) it.next();
              final Address address = (Address) it.next();
              return new OrderHistory(order, address);
            }
          }, getContext().system().dispatcher());
      // aggregated result is piped to another actor
View Full Code Here

TOP

Related Classes of org.akka.essentials.java.future.example.messages.Order

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.