Re: Multiple Service Handling (IKC and HTTP/JSONRPC)

Rocco Caputo <[email protected]>
Newsgroups gmane.comp.lang.perl.poe
Message-ID <[email protected]>
No, it can be fine to combine services---even disparate ones---into  
one program, if that's the best solution to your problem.  Obviously  
the applicability is up to you or your systems designer.

For example, Bot::Pastebot (CPAN) is an IRC client and a pastebin web  
server in one program.

-- 
Rocco Caputo - [email protected]


On Apr 27, 2009, at 20:45, Josh803316 wrote:

> I read the combined service example in the POE cookbook (
> http://poe.perl.org/?POE_Cookbook/Combined_Services).
>
> It gave me an idea to have multiple services handled from a single  
> kernel
> run call. This way, I could handle an ajax request, a separate  
> web_services
> request (json-rpc) as well as ikc client requests (ikc client  
> lite....or ikc
> standard clients).
>
> Would it be foolish to try and do all 3 of these inside one kernel  
> run?
> Could an IKC server handle these types of requests without having to  
> include
> the other 2......with wheels and filters?  I'm still very much  
> learning the
> ins and outs of POE so please excuse my naivete.
>
> POE::Component::IKC::Server->spawn(
>    port => 5667,
>    name => 'automation',
>    verbose => 'true',
> );
>
> POE::Component::Server::HTTP->new
>  ( Port => 5668,
>    ContentHandler => { "/" => \&web_handler },
>    Headers => { Server => 'Sample',
>    },
>  );
>
> POE::Component::Server::JSONRPC->new(
>        Port    => 5669,
>        Handler => {
>            'json_handler' => 'json_handler'
>        },
>    );
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.