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:
>
> &#10;&gt;&#10;&gt; localTaskContext-&gt;requires(&quot;myRemoteOperations&quot;)-&#10;&gt; &gt;getOperationCaller(&quot;remoteGetPeriod&quot;)-&gt;setImplementationPart(&#10;&gt; remoteTaskContext-&gt;provides()-&gt;getOperation( &quot;getPeriod&quot;),&#10;&gt; localTaskContext-&#10;&gt; &gt;engine() )&#10;&gt;&#10;&gt;
>
> You could write a patch that does this function, but wraps it in
> ServiceProvider::connectOperationCaller( string name,
> OperationInterfacePart*
> op) like this:
>
> &#10;&gt;&#10;&gt; localTaskContext-&gt;requires(&quot;myRemoteOperations&quot;)-&#10;&gt; &gt;connectOperationCaller(&quot;remoteGetPeriod&quot;, remoteTaskContext-&gt;provides()-&#10;&gt; &gt;getOperation( &quot;getPeriod&quot;) );&#10;&gt;&#10;&gt;
>
> 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:
> >
> > &#10;&gt; &gt; &#10;&gt; &gt; localTaskContext-&gt;requires(&quot;myRemoteOperations&quot;)-&#10;&gt; &gt; &#10;&gt; &gt; &gt;getOperationCaller(&quot;remoteGetPeriod&quot;)-&gt;setImplementationPart(&#10;&gt; &gt; &#10;&gt; &gt; remoteTaskContext-&gt;provides()-&gt;getOperation( &quot;getPeriod&quot;),&#10;&gt; &gt; localTaskContext-&#10;&gt; &gt; &#10;&gt; &gt; &gt;engine() )&#10;&gt; &gt; &#10;&gt; &gt;
> >
> > You could write a patch that does this function, but wraps it in
> > ServiceProvider::connectOperationCaller( string name,
> > OperationInterfacePart*
> > op) like this:
> >
> > &#10;&gt; &gt; &#10;&gt; &gt; localTaskContext-&gt;requires(&quot;myRemoteOperations&quot;)-&#10;&gt; &gt; &#10;&gt; &gt; &gt;connectOperationCaller(&quot;remoteGetPeriod&quot;, remoteTaskContext-&gt;provides()-&#10;&gt; &gt; &gt;getOperation( &quot;getPeriod&quot;) );&#10;&gt; &gt; &#10;&gt; &gt;
> >
> > 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