val a : Option[FooMessage] = actor !! "foo" // What happens if we reply("pigdog")?
Downside is that !! need Option[Option[_]] result type
Viktor,On 12 May 2010 23:32, Viktor Klang <viktor...@gmail.com> wrote:Downside is that !! need Option[Option[_]] result typeSorry, but that's holy crap! Forget it, please.The issue is, that reply is not parameterized. It boils down to the fact that Actors are not parameterized. If we add a parameter to Actors (Jonas, we already chatted about this at JAX) that determines the type of messages that can be sent to Actors, we know what we are allowed to reply.IMHO this is not only a clean solution for this issue, but this is generally beneficial: Being able to restrict the set of messages that may be sent to an Actor. And this is not too intrusive, because we are free to set the parameter to Any.
HeikoCompany: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Stambecco, highly scalable computing: stambecco.org
--You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
This is a nice complement to the current Actor. But it can not replace it since it is extremely constrained.
That would mean that the Actor can only receive and reply with one single type of message.
Could be nice on and off but I never write actors like that in practice. I much rather have it stay as it is than imposing such a constrain.
If you need that then you could use the Agent which is typed to receive only one type of updating function.
But parameterized actor would be a nice complement for the special case. I'll add that later.
--
Jonas Bonér
http://jayway.com
http://akkasource.com
twitter: jboner
On 13 May 2010 09:59, "Heiko Seeberger" <heiko.s...@googlemail.com> wrote:
Viktor,
On 12 May 2010 23:32, Viktor Klang <viktor...@gmail.com> wrote:
>
>
> Downside is that !! need Op...
Sorry, but that's holy crap! Forget it, please.The issue is, that reply is not parameterized. It boils down to the fact that Actors are not parameterized. If we add a parameter to Actors (Jonas, we already chatted about this at JAX) that determines the type of messages that can be sent to Actors, we know what we are allowed to reply.IMHO this is not only a clean solution for this issue, but this is generally beneficial: Being able to restrict the set of messages that may be sent to an Actor. And this is not too intrusive, because we are free to set the parameter to Any.Heiko
Company: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala...
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To...
Actors are very much dynamic in nature. That is why I like them.
--
Jonas Bonér
http://jayway.com
http://akkasource.com
twitter: jboner
On 13 May 2010 10:07, "Viktor Klang" <viktor...@gmail.com> wrote:
On Thu, May 13, 2010 at 9:59 AM, Heiko Seeberger <heiko.s...@googlemail.com> wrote:
>
> Viktor,...
The problem here is that the param for reply will be varying on the type of the actor or future to be replied to, so this is not a static problem, it's a dynamic problem.
>
>
> Heiko
>
> Company: weiglewilczek.com
> Blog: heikoseeberger.name
> Follow me: twitter.com/hse...
--
Viktor Klang
| "A complex system that works is invariably
| found to have evolved from a simpl...
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To...
Actors are very much dynamic in nature. That is why I like them.
I agree. If we can't make it type safe then we shouldn't pretend that it is.
It will be type safe when we add parameterized Actor base class, but just for one type of return message. Then the user can choose.
--
Jonas Bonér
http://jayway.com
http://akkasource.com
twitter: jboner
On 13 May 2010 10:29, "Viktor Klang" <viktor...@gmail.com> wrote:
On Thu, May 13, 2010 at 10:18 AM, Jonas Bonér <jo...@jonasboner.com> wrote:
>
> Actors are very much...
Me too :-)
My point was more like, since it's dynamic, then really, return types from !! and !!! should be made either Option[Any] or Option[_]
Of course we could add a DSL/util to do easy, typed, extractions
>
> --
> Jonas Bonér
> http://jayway.com
> http://akkasource.com
> twitter: jboner
>>
>> On 13 Ma...
--> You received this message because you are subscribed to the Google Groups "Akka User List" group.
> To post to this group, send email to akka...@googlegroups.com.
> To unsubscribe from this group,...
--Viktor Klang
| "A complex system that works is invariably
| found to have evolved from a simple system
| that worked." - John Gall
Akka - the Actor Kernel: ...
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, sen...
This is a nice complement to the current Actor. But it can not replace it since it is extremely constrained.
That would mean that the Actor can only receive and reply with one single type of message.
Could be nice on and off but I never write actors like that in practice. I much rather have it stay as it is than imposing such a constrain.
I know Goat Rodeo Workers. They are exactly like Akka Agents which is very different from Actors. In Agents you have a single memory slot and send a function to let update itself in-place. They are easy to do type safe.
--
Jonas Bonér
http://jayway.com
http://akkasource.com
twitter: jboner
On 13 May 2010 11:38, "Heiko Seeberger" <heiko.s...@googlemail.com> wrote:
On 13 May 2010 10:17, Jonas Bonér <jo...@jonasboner.com> wrote:
>
> This is a nice complement to the...
I'm misunderstood: I did not mean such a constrained design. Goad Rodeo (Stambecco) does it type safe, so I will look at the details there and hopefully come back with an understandable concept.For the time being I agree that we should not pretend to be type safe => Use Any.Heiko
Company: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Stambecco, hi...
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, sen...
I agree. If we can't make it type safe then we shouldn't pretend that it is.
It will be type safe when we add parameterized Actor base class, but just for one type of return message. Then the user can choose.
On Thu, May 13, 2010 at 4:55 AM, Jonas Bonér <jo...@jonasboner.com> wrote:I agree. If we can't make it type safe then we shouldn't pretend that it is.
It will be type safe when we add parameterized Actor base class, but just for one type of return message. Then the user can choose.
My two cents: I like it the way it is, simply because it makes my code more concise. In all cases where I've been awaiting either a future or a reply, it's a single type that should be returned, and dealing with a few more lines of pattern matching code seems unnecessary. If the reply comes back as another type, an exception will be thrown, but if I didn't expect that type, it's unlikely my code will be written to handle unexpected replies anyway (i.e., I'll probably just log the fact that I got some unexpected message).
Alright, thanks for your input and valueable time
On May 13, 2010 7:27 PM, "Jonas Bonér" <jo...@jonasboner.com> wrote:
On 13 May 2010 15:54, Dustin Whitney <dustin....@gmail.com> wrote:
>
>
>
> On Thu, May 13, 2010 ...
After thinking some I actually agree with Dustin. If we can't solve it better then I prefer the way it is. Now we at least get the API to do an ugly cast for us. Which can generate a runtime error in either case. Just cleaner code.
>
> Dustin
>
>>
>> --
>> Jonas Bonér
>> http://jayway.com
>> http://akkasource.com
>> twitter...
--
Jonas Bonér
work: http://jayway.com
code: http://akkasource.com
blog: http://jonasboner.com
twitter: @jboner
--
You received this message because you are subscribed to the Google Groups "Akka User List" ...