Connecting an OperationCaller with a single Operation instead of an entire service

Hello,

currently, we can connect a ServiceRequester (OperationCallers) with a
Service (Operations) through the connection of the entire service, i.e.
ServiceRequester::connectTo(Service...). However, what if I want to use only
one remote operation? I would like to be able to do something like:

localTaskContext->requires("myRemoteOperations")->getOperationCaller("remoteGetPeriod")->connectTo(remoteTaskContext->provides()->getOperation("getPeriod"));

Unfortunately, this doesn't seem to be possible. Am I wrong?

Philippe

Connecting an OperationCaller with a single Operation instead of

On Friday 08 July 2011 16:15:59 Philippe Hamelin wrote:
> Hello,
>
> currently, we can connect a ServiceRequester (OperationCallers) with a
> Service (Operations) through the connection of the entire service, i.e.
> ServiceRequester::connectTo(Service...). However, what if I want to use
> only one remote operation? I would like to be able to do something like:
>
> localTaskContext->requires("myRemoteOperations")->getOperationCaller("remot
> eGetPeriod")->connectTo(remoteTaskContext->provides()->getOperation("getPer
> iod"));
>
> Unfortunately, this doesn't seem to be possible. Am I wrong?

Try:

localTaskContext->requires("myRemoteOperations")-
>getOperationCaller("remoteGetPeriod")->setImplementationPart( 
remoteTaskContext->provides()->getOperation( "getPeriod"), localTaskContext-
>engine() )

You could write a patch that does this function, but wraps it in
ServiceProvider::connectOperationCaller( string name, OperationInterfacePart*
op) like this:

localTaskContext->requires("myRemoteOperations")-
>connectOperationCaller("remoteGetPeriod", remoteTaskContext->provides()-
>getOperation( "getPeriod") );

Is nicer to use and voids mistakes of taking the wrong engine()

>
> Philippe

Peter

Connecting an OperationCaller with a single Operation instead of

2011/7/12 Peter Soetens <peter [..] ...>

> On Friday 08 July 2011 16:15:59 Philippe Hamelin wrote:
> > Hello,
> >
> > currently, we can connect a ServiceRequester (OperationCallers) with a
> > Service (Operations) through the connection of the entire service, i.e.
> > ServiceRequester::connectTo(Service...). However, what if I want to use
> > only one remote operation? I would like to be able to do something like:
> >
> >
> localTaskContext->requires("myRemoteOperations")->getOperationCaller("remot
> >
> eGetPeriod")->connectTo(remoteTaskContext->provides()->getOperation("getPer
> > iod"));
> >
> > Unfortunately, this doesn't seem to be possible. Am I wrong?
>
>
> Try:
>
>

>
> localTaskContext->requires("myRemoteOperations")-
> >getOperationCaller("remoteGetPeriod")->setImplementationPart(
> remoteTaskContext->provides()->getOperation( "getPeriod"),
> localTaskContext-
> >engine() )
>
> 

>
> You could write a patch that does this function, but wraps it in
> ServiceProvider::connectOperationCaller( string name,
> OperationInterfacePart*
> op) like this:
>
>
>
> localTaskContext->requires("myRemoteOperations")-
> >connectOperationCaller("remoteGetPeriod", remoteTaskContext->provides()-
> >getOperation( "getPeriod") );
>
> 

>
> Is nicer to use and voids mistakes of taking the wrong engine()
>
>
What if I need to connect two remote operations using a third process? What
would be the execution engine?

Philippe

Connecting an OperationCaller with a single Operation instead of

On Monday 01 August 2011 17:09:54 Philippe Hamelin wrote:
> 2011/7/12 Peter Soetens <peter [..] ...>
>
> > On Friday 08 July 2011 16:15:59 Philippe Hamelin wrote:
> > > Hello,
> > >
> > > currently, we can connect a ServiceRequester (OperationCallers) with a
> > > Service (Operations) through the connection of the entire service, i.e.
> > > ServiceRequester::connectTo(Service...). However, what if I want to use
> >
> > > only one remote operation? I would like to be able to do something like:
> > localTaskContext->requires("myRemoteOperations")->getOperationCaller("rem
> > ot
> >
> > eGetPeriod")->connectTo(remoteTaskContext->provides()->getOperation("getP
> > er
> >
> > > iod"));
> > >
> > > Unfortunately, this doesn't seem to be possible. Am I wrong?
> >
> > Try:
> >
> >

> > 
> > localTaskContext->requires("myRemoteOperations")-
> > 
> > >getOperationCaller("remoteGetPeriod")->setImplementationPart(
> > 
> > remoteTaskContext->provides()->getOperation( "getPeriod"),
> > localTaskContext-
> > 
> > >engine() )
> > 
> > 

> >
> > You could write a patch that does this function, but wraps it in
> > ServiceProvider::connectOperationCaller( string name,
> > OperationInterfacePart*
> > op) like this:
> >
> >
> > 
> > localTaskContext->requires("myRemoteOperations")-
> > 
> > >connectOperationCaller("remoteGetPeriod", remoteTaskContext->provides()-
> > >getOperation( "getPeriod") );
> > 
> > 

> >
> > Is nicer to use and voids mistakes of taking the wrong engine()
>
> What if I need to connect two remote operations using a third process? What
> would be the execution engine?

It's always the engine of the caller. The receiver (which executes the Op)
knows it's own engine, but it needs the engine of the caller to wake it up in
case it's blocking. That's the only reason we pass on the caller's engine.

Peter