Re: [brando] Using Response extractors
- Mark Grey
- 2014-04-09 @ 18:33
Many many thanks Gaetan, this is great!
On Wed, Apr 9, 2014 at 12:37 PM, Gaetan Hervouet <email@example.com>wrote:
> Hi MG,
> I put up a gist together to help you with the extractors :
> Basically, the exactors uses the unapply method. This can be used anywhere
> you are doing pattern matching (for yield loop, receive... )
> In this example, brando is going to reply with a List[Option[ByteString]]
> to the actor.
> Response.AsStringsHash matches on that and extracts a Map[Stri ng,String]
> from it. That's what you'll get in the hash variable.
> Hope this helps.
> > Hey All,
> > Relatively new to scala and trying out Brando as part of a boilerplate
> learning project.
> > I'm a little confused how to use the response extractors? Right now, I
> just match in my receive method on Some[ByteString] to see the responses
> from my brando actor instance. Is there a way to match directly on the
> type of response? Could someone provide a usage example of this that
> doesn't use the ask pattern in the wiki? Thanks!
> > ~MG