Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
TypedActor message dispatch semantics
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
r4dium  
View profile  
 More options Feb 11, 9:19 pm
From: r4dium <a...@profindis.de>
Date: Sat, 11 Feb 2012 18:19:20 -0800 (PST)
Local: Sat, Feb 11 2012 9:19 pm
Subject: TypedActor message dispatch semantics
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>" ?

Help appreciated!

Regards
R4dium


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roland Kuhn  
View profile  
 More options Feb 12, 3:21 am
From: Roland Kuhn <goo...@rkuhn.info>
Date: Sun, 12 Feb 2012 09:21:45 +0100
Local: Sun, Feb 12 2012 3:21 am
Subject: Re: [akka-user] TypedActor message dispatch semantics

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r4dium  
View profile  
 More options Feb 12, 4:35 am
From: r4dium <a...@profindis.de>
Date: Sun, 12 Feb 2012 01:35:35 -0800 (PST)
Local: Sun, Feb 12 2012 4:35 am
Subject: Re: TypedActor message dispatch semantics
On 12 Feb., 09:21, Roland Kuhn <goo...@rkuhn.info> wrote:

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":

 akka.dispatch.DefaultPromise cannot be cast to
com.cisco.www.irrupt.remoteservices.businesslayer.tasks.Promize
java.lang.ClassCastException: akka.dispatch.DefaultPromise cannot be
cast to
com.cisco.www.irrupt.remoteservices.businesslayer.tasks.Promize
        at $Proxy7.update(Unknown Source)

Any idea?

Regards

R4DIUM


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
√iktor Ҡlang  
View profile  
 More options Feb 12, 12:20 pm
From: √iktor Ҡlang <viktor.kl...@gmail.com>
Date: Sun, 12 Feb 2012 18:20:19 +0100
Local: Sun, Feb 12 2012 12:20 pm
Subject: Re: [akka-user] Re: TypedActor message dispatch semantics

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?

--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r4dium  
View profile  
 More options Feb 12, 5:08 pm
From: r4dium <a...@profindis.de>
Date: Sun, 12 Feb 2012 14:08:24 -0800 (PST)
Local: Sun, Feb 12 2012 5:08 pm
Subject: Re: TypedActor message dispatch semantics
Thx, for the hint - But I didn't understand it :-)

JavaDoc:
Completes this Promise with the specified result, if not already
completed.

This is exactly what my Promize.complete() does or not?

Can you please elaborate on this, would be very helpfull.

R4DIUM

On 12 Feb., 18:20, √iktor Ҡlang <viktor.kl...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
√iktor Ҡlang  
View profile  
 More options Feb 13, 2:47 pm
From: √iktor Ҡlang <viktor.kl...@gmail.com>
Date: Mon, 13 Feb 2012 20:47:47 +0100
Local: Mon, Feb 13 2012 2:47 pm
Subject: Re: [akka-user] Re: TypedActor message dispatch semantics

On Sun, Feb 12, 2012 at 11:08 PM, r4dium <a...@profindis.de> wrote:
> Thx, for the hint - But I didn't understand it :-)

> JavaDoc:
> Completes this Promise with the specified result, if not already
> completed.

> This is exactly what my Promize.complete() does or not?

> Can you please elaborate on this, would be very helpfull.

What is the return type of the complete method in the docs:
http://akka.io/api/akka/2.0-M4/#akka.dispatch.Promise

--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r4dium  
View profile  
 More options Feb 16, 6:15 pm
From: r4dium <a...@profindis.de>
Date: Thu, 16 Feb 2012 15:15:02 -0800 (PST)
Local: Thurs, Feb 16 2012 6:15 pm
Subject: Re: TypedActor message dispatch semantics
Well, it returns "this" and not a "new Promize()".
However, if I return "this", the same excetion gets thrown:

"akka.dispatch.DefaultPromise cannot be
cast to
com.cisco.www.irrupt.remoteservices.businesslayer.tasks.Promize"

On 13 Feb., 20:47, √iktor Ҡlang <viktor.kl...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »