[MOBY-dev] perl async services

Edward Kawas edward.kawas at gmail.com
Mon Aug 11 13:14:18 UTC 2008


Excellent!

Thanks.

Eddie

-----Original Message-----
From: moby-dev-bounces at lists.open-bio.org
[mailto:moby-dev-bounces at lists.open-bio.org] On Behalf Of José María
Fernández González
Sent: August-08-08 3:20 AM
To: Core developer announcements
Subject: Re: [MOBY-dev] perl async services

Now I see what you mean. Yes, it should be possible in the way you have 
explained because both of them should be inheriting from 
MOBY::Async::SimpleServer. Perhaps one of the cleaner ways to specify that
is:

$server->dispatch_with({
     $WSRF::Constants::MOBY.'#serviceOne'        => 'OneAsyncService',
     $WSRF::Constants::MOBY.'#serviceOne_submit' => 'OneAsyncService',
     $WSRF::Constants::MOBY.'#serviceTwo'        => 'TwoAsyncService',
     $WSRF::Constants::MOBY.'#serviceTwo_submit' => 'TwoAsyncService',

 
$WSRF::Constants::WSRPW.'/GetResourceProperty/GetResourcePropertyRequest'
         => 'MOBY::Async::SimpleServer',

$WSRF::Constants::WSRPW.'/GetMultipleResourceProperties/GetMultipleResourceP
ropertiesRequest'
         => 'MOBY::Async::SimpleServer',

     $WSRF::Constants::WSRLW.'/ImmediateResourceTermination/DestroyRequest'
         => 'MOBY::Async::SimpleServer',
});

	Best Regards,
		José María

Edward Kawas wrote:
> Thanks for the quick response! So your example have both service
> implementations inside of one file. Is it possible to have more than one
> service referenced in the dispatcher without have the implementations in
the
> same package?
> 
> i.e. ('->' shows what I mean):
> 
> $server->dispatch_with({
> ->       $WSRF::Constants::MOBY.'#serviceOne'        => 'OneAsyncService',
> ->       $WSRF::Constants::MOBY.'#serviceOne_submit' => 'OneAsyncService',
>          $WSRF::Constants::MOBY.'#serviceTwo'        => 'TwoAsyncService',
>          $WSRF::Constants::MOBY.'#serviceTwo_submit' => 'TwoAsyncService',
>  
> $WSRF::Constants::WSRPW.'/GetResourceProperty/GetResourcePropertyRequest'
=>
> 'TwoAsyncService',
> 	
>
$WSRF::Constants::WSRPW.'/GetMultipleResourceProperties/GetMultipleResourceP
> ropertiesRequest' => 'TwoAsyncService',
> 	
> $WSRF::Constants::WSRLW.'/ImmediateResourceTermination/DestroyRequest' =>
> 'TwoAsyncService',
> });
> 
> Thanks again,
> 
> Eddie
> 
> -----Original Message-----
> From: moby-dev-bounces at lists.open-bio.org
> [mailto:moby-dev-bounces at lists.open-bio.org] On Behalf Of José María
> Fernández González
> Sent: August-07-08 9:49 AM
> To: Core developer announcements
> Subject: Re: [MOBY-dev] perl async services
> 
> Hi Eddie,
> 	although the example shows only one service, you are not restricted
> to only one. About GetResourceProperty, GetMultipleResourceProperties and
> ImmediateResourceTermination, they are document/literal SOAP services
based
> on WSRF specifications. If your service code is inheriting from
> MOBY::Async::SimpleServer, then you do not have to implement them, because
> MOBY::Async::SimpleServer takes care of them.
> 
> 	The way MOBY::Async libraries work are the next:
> 
> *	They have been built on top of WSRF::Lite libraries, so they reuse
> as much 
> routines as possible. That's the reason why Perl modules containing
> asynchronous services implementations must inherit from
> MOBY::Async::SimpleServer (typical 'use base
qw(MOBY::Async::SimpleServer);'
> 
> sentence).
> 
> *	Asynchronous services creators/coders only have to write the
> corresponding 
> job routines as they were creating a synchronous MOBY service. All the job
> ticket generation, job management, job result status & storage, etc...
work
> is handled either by WSRF::Lite or MOBY::Async::SimpleServer, and in most
of
> cases only depends on job Id. As job routines are passed on job creation,
> they must be either functions passed by reference to the job creation
> statement or being anonymous functions assigned to a variable, used as
input
> parameter for the job creation statement.
> 
> 	For those of you interested on, the ticket, state, results, etc... 
> information is stored in /tmp. This point should be more configurable, and
> we will fix it on September.
> 
> 	I have attached an untested example of two asynchronous services
> using the same dispatcher and module.
> 
> 	Best Regards from Málaga,
> 		José María (on behalf José Manuel and myself)
> 
> Edward Kawas wrote:
>> Hi,
>>
>> I have a quick question to whomever has developed async services in 
>> perl using the MOBY::Async/WSRF modules. Is it true that there is a 
>> strict one dispatcher file to one service?
>>
>> For instance, the documentation for the module MOBY::Async has the 
>> following dispatcher.cgi example:
>>
>> dispatcher.cgi
>>
>>   #!/usr/bin/perl
>>   BEGIN { @INC = ("/path/to/my/libs", @INC); } 
>>   use strict;
>>   use SOAP::Transport::HTTP;
>>   use MOBY::Async::WSRF;
>>   use HelloWorld;
>>
>>   my $server = new SOAP::Transport::HTTP::CGI;
>>   $server->serializer(WSRF::Serializer->new);
>>   $server->deserializer(WSRF::Deserializer->new);
>>   $server->on_action(sub{});
>>   $server->dispatch_with({
>>     $WSRF::Constants::MOBY.'#sayHello'        => 'HelloWorld',
>>     $WSRF::Constants::MOBY.'#sayHello_submit' => 'HelloWorld',
>> ->
>> $WSRF::Constants::WSRPW.'/GetResourceProperty/GetResourcePropertyReque
>> st' => 'HelloWorld',
>> ->
>> $WSRF::Constants::WSRPW.'/GetMultipleResourceProperties/GetMultipleRes
>> ourceP
>> ropertiesRequest' => 'HelloWorld',
>> ->
$WSRF::Constants::WSRLW.'/ImmediateResourceTermination/DestroyRequest'
>> => 'HelloWorld',
>>   });
>>   $server->handle();
>>
>> Notice the lines prefixed with '->' hard code GetResourceProperty, etc 
>> map to a specific service. Is there any way around this?
>>
>> Thanks,
>>
>> Eddie
>>
>>
>>
>> _______________________________________________
>> MOBY-dev mailing list
>> MOBY-dev at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/moby-dev
>>
> 
> --
> "There is no reason why anybody would want a computer in their home" -
> 	Ken Olson, founder of DEC 1977
> "640K ought to be enough for anybody" - Bill Gates, 1981 "Nobody will ever
> outgrow a 20Mb hard drive." - ???
> 
> "Premature optimization is the root of all evil." - Donald Knuth
> 
> José María Fernández González
> Tlfn: (+34) 91 732 80 00 / 91 224 69 00 (ext 3061)
> e-mail: jmfernandez at cnio.es		Fax: (+34) 91 224 69 76
> Unidad del Instituto Nacional de Bioinformática
> Biología Estructural y Biocomputación	Structural Biology and Biocomputing
> Centro Nacional de Investigaciones Oncológicas
> C.P.: 28029				Zip Code: 28029
> C/. Melchor Fernández Almagro, 3	Madrid (Spain)
> 
> 
> **NOTA DE CONFIDENCIALIDAD** Este correo electrónico, y en su caso los
> ficheros adjuntos, pueden contener información protegida para el uso
> exclusivo de su destinatario. Se prohíbe la distribución, reproducción o
> cualquier otro tipo de transmisión por parte de otra persona que no sea el
> destinatario. Si usted recibe por error este correo, se ruega comunicarlo
al
> remitente y borrar el mensaje recibido.
> **CONFIDENTIALITY NOTICE** This email communication and any attachments
may
> contain confidential and privileged information for the sole use of the
> designated recipient named above. Distribution, reproduction or any other
> use of this transmission by any party other than the intended recipient is
> prohibited. If you are not the intended recipient please contact the
sender
> and delete all copies.
> 
> 
> 
> _______________________________________________
> MOBY-dev mailing list
> MOBY-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/moby-dev
> 

-- 
"There is no reason why anybody would want a computer in their home" -
	Ken Olson, founder of DEC 1977
"640K ought to be enough for anybody" - Bill Gates, 1981
"Nobody will ever outgrow a 20Mb hard drive." - ???

"Premature optimization is the root of all evil." - Donald Knuth

José María Fernández González
Tlfn: (+34) 91 732 80 00 / 91 224 69 00 (ext 3061)
e-mail: jmfernandez at cnio.es		Fax: (+34) 91 224 69 76
Unidad del Instituto Nacional de Bioinformática
Biología Estructural y Biocomputación	Structural Biology and Biocomputing
Centro Nacional de Investigaciones Oncológicas
C.P.: 28029				Zip Code: 28029
C/. Melchor Fernández Almagro, 3	Madrid (Spain)

**NOTA DE CONFIDENCIALIDAD** Este correo electrónico, y en su caso los
ficheros adjuntos, pueden contener información protegida para el uso
exclusivo de su destinatario. Se prohíbe la distribución, reproducción o
cualquier otro tipo de transmisión por parte de otra persona que no sea el
destinatario. Si usted recibe por error este correo, se ruega comunicarlo al
remitente y borrar el mensaje recibido.
**CONFIDENTIALITY NOTICE** This email communication and any attachments may
contain confidential and privileged information for the sole use of the
designated recipient named above. Distribution, reproduction or any other
use of this transmission by any party other than the intended recipient is
prohibited. If you are not the intended recipient please contact the sender
and delete all copies.

_______________________________________________
MOBY-dev mailing list
MOBY-dev at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/moby-dev





More information about the MOBY-dev mailing list