For those who are interested, I have just cut the second major release of the
Requester library <https://github.com/jducoeur/Requester>, with many
improvements over 1.1.


*What it is:* Requester introduces request(), which can be thought of as
the better-behaved big brother to ask().  ask() returns a Future, and is
therefore quite dangerous to use inside of an Actor, because the Future
violates the single-threadedness of the Actor, and doesn't preserve sender.
 request(), by contrast, loops the result of its request back into the
Actor's mailbox *and* preserves sender across the whole thing.  Basically,
request() works the way you intuitively *expect* ask() to work.

As a result, Requester allows you to safely write completely natural,
composed, multi-Actor code inside of an Actor, like this:

case GetSpacesStatus(requester) => {
  for {
    ActiveThings(nConvs) <- conversations ? GetActiveThings
    ActiveSessions(nSessions) <- sessions ? GetActiveSessions
  }
    sender ! SpaceStatus(spaceId, state.displayName, nConvs, nSessions)
}

There is a lot more -- Requester is heavily used by Querki
<https://www.querki.net/help/#What-is-Querki>, and I've been evolving it
steadily.  At this point, I think it's in good shape for other folks to
make serious use of it.  I invite y'all to play with it; comments and PRs
are warmly welcomed.

(And yes, I still need to write up a PR for the Akka documentation, for the
external contributions section. I hadn't done so before because I wasn't
happy enough about the state of things, but it seems to be getting solid
enough now.)


*Changes in 2.0*

The most important change is that RequestM (the equivalent of Future -- a
block of work that will be executed in the Actor's receive loop) is now
much better-behaved, monadically. By and large, you can treat a RequestM
like a Future, and it will typically do what you expect.  In particular,
RequestMs now generally compose correctly, where they previously only
composed in certain ways.

There is now an implicit conversion from RequestM[T] to Future[T].  This
makes it easier to use when your Actor is implementing Future-oriented
functions.  (Which I find comes up in client-server RPC programming.)

The loopback is now caught in unhandled(), so you can usually just mix in
Requester and start using it.  You only need to explicitly call
handleRequestResponse under certain special circumstances.

? is now an alias for request(), intentionally mimicking ask().

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to