Remoting Proxy / AsyncProxy

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Remoting Proxy / AsyncProxy

go2ghana
Hi,
would it be possible to change haxe.remoting.Proxy/AsyncProxy to accept
an Interface instead of a Class as type parameter?
This way we won't need to put all those tedious
#if target
#endif
inside the api implementation?

Cordially,
Axel


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Remoting Proxy / AsyncProxy

blackdog
On 11/07/2011 04:32 AM, Axel Huizinga wrote:

> Hi,
> would it be possible to change haxe.remoting.Proxy/AsyncProxy to
> accept an Interface instead of a Class as type parameter?
> This way we won't need to put all those tedious
> #if target
> #endif
> inside the api implementation?
>
> Cordially,
> Axel
>
>
+1

--
Simplicity is the ultimate sophistication. ~ Leonardo da Vinci


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Remoting Proxy / AsyncProxy

Nicolas Cannasse
In reply to this post by go2ghana
Le 07/11/2011 08:32, Axel Huizinga a écrit :
> Hi,
> would it be possible to change haxe.remoting.Proxy/AsyncProxy to accept
> an Interface instead of a Class as type parameter?
> This way we won't need to put all those tedious
> #if target
> #endif
> inside the api implementation?

Add it to haxe issues on code.google.com/p/haxe
Not sure when I'll have time to add it.

Best,
Nicolas


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Remoting Proxy / AsyncProxy

Cauê W.
AFAIK it already works with interfaces, doesn't it? Only if something has changed very recently, but look here:

It's using interfaces with proxy

2011/11/7 Nicolas Cannasse <[hidden email]>
Le 07/11/2011 08:32, Axel Huizinga a écrit :

Hi,
would it be possible to change haxe.remoting.Proxy/AsyncProxy to accept
an Interface instead of a Class as type parameter?
This way we won't need to put all those tedious
#if target
#endif
inside the api implementation?

Add it to haxe issues on code.google.com/p/haxe
Not sure when I'll have time to add it.

Best,
Nicolas



--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Remoting Proxy / AsyncProxy

go2ghana
Am 07.11.2011 12:50, schrieb Cauê Waneck:
> AFAIK it already works with interfaces, doesn't it? Only if something
> has changed very recently, but look here:
> http://haxe.org/doc/flash/chat
>
> It's using interfaces with proxy
Indeed - it is using interfaces - great.
Btw - is there a way to do something similar in a php server / js client
context?
I can use the ServerApi on the client like:

class MediaServiceImpl extends
haxe.remoting.AsyncProxy<me.cunity.js.IMediaServiceApi> { }


class MediaClient implements IMediaClient
{
     public static function main()
     {
         var cnx = HttpAsyncConnection.urlConnect('index.php');
         var mediaService = new MediaServiceImpl(cnx);
         ...
     }
}

but wonder how to add the ClientApi object on the Server which starts like:

     static function main()
     {
         instance = new MediaService();
         context = new haxe.remoting.Context();
         context.addObject("api",instance);
         haxe.remoting.HttpConnection.handleRequest(context);
     }



@Nicolas: I was glad to read you are ready to consider this change -
however it looks like we only need to extend the docs.


> 2011/11/7 Nicolas Cannasse <[hidden email]
> <mailto:[hidden email]>>
>
>     Le 07/11/2011 08:32, Axel Huizinga a écrit :
>
>         Hi,
>         would it be possible to change haxe.remoting.Proxy/AsyncProxy
>         to accept
>         an Interface instead of a Class as type parameter?
>         This way we won't need to put all those tedious
>         #if target
>         #endif
>         inside the api implementation?
>
>
>     Add it to haxe issues on code.google.com/p/haxe
>     <http://code.google.com/p/haxe>
>     Not sure when I'll have time to add it.
>
>     Best,
>     Nicolas
>
>
>
>     --
>     haXe - an open source web programming language
>     http://haxe.org
>
>
>
>


--
haXe - an open source web programming language
http://haxe.org