> On 12 feb 2012, at 03:19, r4dium <a...@profindis.de> wrote:
> > The documentation states:
> > akka.dispatch.Future<?> will use send-request-reply semantics, exactly
> > like ActorRef.ask
> > Now, does this only apply to methods which specify Future<?> as
> > return value e.g.
> > Future<T> mytest()
> > or also to methods which return a subclass of Future<?> e.g.
> > " Promize<T> mytest()
> > where Promize<T> implements Promise<T>" ?
> Should work for any subtype of Future. Did you encounter any problems?
> Regards,
> Roland Kuhn
> Typesafe — The software stack for applications that scale
> twitter: @rolandkuhn
Well, I am not sure......
I extended Promise in the above mentioned way:
public class Promize<T> implements akka.dispatch.Promise<T>
{
.....
public Promize<T> complete(Either<Throwable, T> arg0)
{
return new Promize<T>( _promise.complete(arg0) );
}
.....
}
which basically wraps the DefaultPromise _promise:
_promise = new
DefaultPromise<T>( ActorSystemSingleton.get().dispatcher() );
Now I have a typed-actor "task" which implements the following method:
public Promize<Object> update(String msg)
{
_extractedText = msg;
return new Promize<Object>().complete( new Right<Throwable,
Object>(null) );
}
which gets called by:
Promize<Object> p = task.update( d.extractText(data) );
However, it seems that before reaching the row "return new
Promize<Object>().complete( new Right<Throwable, Object>(null) );" the
following
exception gets thrown by the proxy of "task":
On Sun, Feb 12, 2012 at 10:35 AM, r4dium <a...@profindis.de> wrote: > On 12 Feb., 09:21, Roland Kuhn <goo...@rkuhn.info> wrote: >> On 12 feb 2012, at 03:19, r4dium <a...@profindis.de> wrote:
>> > The documentation states: >> > akka.dispatch.Future<?> will use send-request-reply semantics, exactly >> > like ActorRef.ask
>> > Now, does this only apply to methods which specify Future<?> as >> > return value e.g.
>> > Future<T> mytest()
>> > or also to methods which return a subclass of Future<?> e.g.
>> > " Promize<T> mytest()
>> > where Promize<T> implements Promise<T>" ?
>> Should work for any subtype of Future. Did you encounter any problems?
>> Regards,
>> Roland Kuhn >> Typesafe — The software stack for applications that scale >> twitter: @rolandkuhn
> Well, I am not sure......
> I extended Promise in the above mentioned way:
> public class Promize<T> implements akka.dispatch.Promise<T> > { > ..... > public Promize<T> complete(Either<Throwable, T> arg0) > { > return new Promize<T>( _promise.complete(arg0) ); > }
That is not according to the contract for "complete", read the ScalaDoc.
> ..... > }
> which basically wraps the DefaultPromise _promise: > _promise = new > DefaultPromise<T>( ActorSystemSingleton.get().dispatcher() );
> Now I have a typed-actor "task" which implements the following method:
> public Promize<Object> update(String msg) > { > _extractedText = msg; > return new Promize<Object>().complete( new Right<Throwable, > Object>(null) );
> which gets called by: > Promize<Object> p = task.update( d.extractText(data) );
> However, it seems that before reaching the row "return new > Promize<Object>().complete( new Right<Throwable, Object>(null) );" the > following > exception gets thrown by the proxy of "task":
> -- > 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-user@googlegroups.com. > To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
-- Viktor Klang
Akka Tech Lead Typesafe - The software stack for applications that scale
> On Sun, Feb 12, 2012 at 10:35 AM, r4dium <a...@profindis.de> wrote:
> > On 12 Feb., 09:21, Roland Kuhn <goo...@rkuhn.info> wrote:
> >> On 12 feb 2012, at 03:19, r4dium <a...@profindis.de> wrote:
> >> > The documentation states:
> >> > akka.dispatch.Future<?> will use send-request-reply semantics, exactly
> >> > like ActorRef.ask
> >> > Now, does this only apply to methods which specify Future<?> as
> >> > return value e.g.
> >> > Future<T> mytest()
> >> > or also to methods which return a subclass of Future<?> e.g.
> >> > " Promize<T> mytest()
> >> > where Promize<T> implements Promise<T>" ?
> >> Should work for any subtype of Future. Did you encounter any problems?
> >> Regards,
> >> Roland Kuhn
> >> Typesafe — The software stack for applications that scale
> >> twitter: @rolandkuhn
> > Well, I am not sure......
> > I extended Promise in the above mentioned way:
> > public class Promize<T> implements akka.dispatch.Promise<T>
> > {
> > .....
> > public Promize<T> complete(Either<Throwable, T> arg0)
> > {
> > return new Promize<T>( _promise.complete(arg0) );
> > }
> That is not according to the contract for "complete", read the ScalaDoc.
> > .....
> > }
> > which basically wraps the DefaultPromise _promise:
> > _promise = new
> > DefaultPromise<T>( ActorSystemSingleton.get().dispatcher() );
> > Now I have a typed-actor "task" which implements the following method:
> > public Promize<Object> update(String msg)
> > {
> > _extractedText = msg;
> > return new Promize<Object>().complete( new Right<Throwable,
> > Object>(null) );
> What is this?
> > }
> > which gets called by:
> > Promize<Object> p = task.update( d.extractText(data) );
> > However, it seems that before reaching the row "return new
> > Promize<Object>().complete( new Right<Throwable, Object>(null) );" the
> > following
> > exception gets thrown by the proxy of "task":
> > --
> > 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-user@googlegroups.com.
> > To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/akka-user?hl=en.
> --
> Viktor Klang
> Akka Tech Lead
> Typesafe - The software stack for applications that scale
> On 12 Feb., 18:20, √iktor Ҡlang <viktor.kl...@gmail.com> wrote: >> On Sun, Feb 12, 2012 at 10:35 AM, r4dium <a...@profindis.de> wrote: >> > On 12 Feb., 09:21, Roland Kuhn <goo...@rkuhn.info> wrote: >> >> On 12 feb 2012, at 03:19, r4dium <a...@profindis.de> wrote:
>> >> > The documentation states: >> >> > akka.dispatch.Future<?> will use send-request-reply semantics, exactly >> >> > like ActorRef.ask
>> >> > Now, does this only apply to methods which specify Future<?> as >> >> > return value e.g.
>> >> > Future<T> mytest()
>> >> > or also to methods which return a subclass of Future<?> e.g.
>> >> > " Promize<T> mytest()
>> >> > where Promize<T> implements Promise<T>" ?
>> >> Should work for any subtype of Future. Did you encounter any problems?
>> >> Regards,
>> >> Roland Kuhn >> >> Typesafe — The software stack for applications that scale >> >> twitter: @rolandkuhn
>> > Well, I am not sure......
>> > I extended Promise in the above mentioned way:
>> > public class Promize<T> implements akka.dispatch.Promise<T> >> > { >> > ..... >> > public Promize<T> complete(Either<Throwable, T> arg0) >> > { >> > return new Promize<T>( _promise.complete(arg0) ); >> > }
>> That is not according to the contract for "complete", read the ScalaDoc.
>> > ..... >> > }
>> > which basically wraps the DefaultPromise _promise: >> > _promise = new >> > DefaultPromise<T>( ActorSystemSingleton.get().dispatcher() );
>> > Now I have a typed-actor "task" which implements the following method:
>> > public Promize<Object> update(String msg) >> > { >> > _extractedText = msg; >> > return new Promize<Object>().complete( new Right<Throwable, >> > Object>(null) );
>> What is this?
>> > }
>> > which gets called by: >> > Promize<Object> p = task.update( d.extractText(data) );
>> > However, it seems that before reaching the row "return new >> > Promize<Object>().complete( new Right<Throwable, Object>(null) );" the >> > following >> > exception gets thrown by the proxy of "task":
>> > -- >> > 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-user@googlegroups.com. >> > To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com. >> > For more options, visit this group athttp://groups.google.com/group/akka-user?hl=en.
>> -- >> Viktor Klang
>> Akka Tech Lead >> Typesafe - The software stack for applications that scale
>> Twitter: @viktorklang
> -- > 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-user@googlegroups.com. > To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
-- Viktor Klang
Akka Tech Lead Typesafe - The software stack for applications that scale
> > On 12 Feb., 18:20, √iktor Ҡlang <viktor.kl...@gmail.com> wrote:
> >> On Sun, Feb 12, 2012 at 10:35 AM,r4dium<a...@profindis.de> wrote:
> >> > On 12 Feb., 09:21, Roland Kuhn <goo...@rkuhn.info> wrote:
> >> >> On 12 feb 2012, at 03:19,r4dium<a...@profindis.de> wrote:
> >> >> > The documentation states:
> >> >> > akka.dispatch.Future<?> will use send-request-reply semantics, exactly
> >> >> > like ActorRef.ask
> >> >> > Now, does this only apply to methods which specify Future<?> as
> >> >> > return value e.g.
> >> >> > Future<T> mytest()
> >> >> > or also to methods which return a subclass of Future<?> e.g.
> >> >> > " Promize<T> mytest()
> >> >> > where Promize<T> implements Promise<T>" ?
> >> >> Should work for any subtype of Future. Did you encounter any problems?
> >> >> Regards,
> >> >> Roland Kuhn
> >> >> Typesafe — The software stack for applications that scale
> >> >> twitter: @rolandkuhn
> >> > Well, I am not sure......
> >> > I extended Promise in the above mentioned way:
> >> > public class Promize<T> implements akka.dispatch.Promise<T>
> >> > {
> >> > .....
> >> > public Promize<T> complete(Either<Throwable, T> arg0)
> >> > {
> >> > return new Promize<T>( _promise.complete(arg0) );
> >> > }
> >> That is not according to the contract for "complete", read the ScalaDoc.
> >> > .....
> >> > }
> >> > which basically wraps the DefaultPromise _promise:
> >> > _promise = new
> >> > DefaultPromise<T>( ActorSystemSingleton.get().dispatcher() );
> >> > Now I have a typed-actor "task" which implements the following method:
> >> > public Promize<Object> update(String msg)
> >> > {
> >> > _extractedText = msg;
> >> > return new Promize<Object>().complete( new Right<Throwable,
> >> > Object>(null) );
> >> What is this?
> >> > }
> >> > which gets called by:
> >> > Promize<Object> p = task.update( d.extractText(data) );
> >> > However, it seems that before reaching the row "return new
> >> > Promize<Object>().complete( new Right<Throwable, Object>(null) );" the
> >> > following
> >> > exception gets thrown by the proxy of "task":
> >> > --
> >> > 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-user@googlegroups.com.
> >> > To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
> >> > For more options, visit this group athttp://groups.google.com/group/akka-user?hl=en.
> >> --
> >> Viktor Klang
> >> Akka Tech Lead
> >> Typesafe - The software stack for applications that scale
> >> Twitter: @viktorklang
> > --
> > 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-user@googlegroups.com.
> > To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/akka-user?hl=en.
> --
> Viktor Klang
> Akka Tech Lead
> Typesafe - The software stack for applications that scale