Thanks Messrs Fulton and Stanchenko for the replies, and for sharing such 
useful code. I looked at Scaloid previously but found some of the design 
decisions were not quite what I would expect, and I'm happy to see Macroid 
provides an alternative. mapUi sounds like just what I'm looking for.

To quickly answer why you'd want to treat a Handler as if it were an actor, 
I was thinking that it would be easy to send work to a back-end actor from 
the main thread with ? and get the result back as a message to a Handler on 
that thread. That way, I'd be able to keep my layers separate (avoid 
back-end code calling directly into the GUI code) without having to 
handwrite a "crossbar" actor that translates between Handler code and Actor 
messages. Even with this, though, I'm not yet convinced by Akka actors. 
They might be great for big distributed systems where failover and location 
transparency are important, but for Android apps they seem to be just an 
overcomplicated message queue which you have to throw away static 
type-safety to use.

On Tuesday, 10 June 2014 20:07:21 UTC+1, Nick Stanchenko wrote:
>
>
>>    - Is there some way to communicate with a Handler on the main thread 
>>    as if it were an Akka Actor?
>>
>> Apologies, I misread the question (as “if we were an Akka Actor”). You 
> could create a separate actor, that would redirect anything being sent to 
> it to the main Handler — using one of the approaches I described above. 
> However I don’t see much benefit in that, since you can submit code to the 
> Handler from any actor.
>
> Nick
>

-- 
You received this message because you are subscribed to the Google Groups 
"scala-on-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to