public Future<Foo> giveMeSomeFoo(int id) {
Stats.incr("number_of_foo_calls"); // Report stats to Ostrich// Domain objects are immutable. They come with constructors and builders. Foo foo = new Foo.Builder()
.bar("test")
.bazz("hey, this is a response from " + bazz)
.squirrel(42)
.build();
// Finagle is async, so wrap the return value in a Future// if the implementation is synchronousreturn Future.value(foo);
}
}