Hi,

On Tue, Jun 12, 2012 at 12:50 PM, A Kobame <kobam...@gmail.com> wrote:
> I want run more different applications under STARMAN, so my app.psgi
> will looks like:
>
[...]
>
> the question is:
>
> how to correctly configure the two poet apps, when
> - they are in separate trees (different dirs, different components,
> different config key-values, but
>    - one Startman (plackup for development) but later for production
> want Starman
>    - one "/static"
>
> want use poet - not pure Mason (because maybe someday will move the
> apps into separate computers, so want use $poet's config YAML and
> so..)
>
> Any recommendation?

AFAIK, you can't. There can be only one Poet app per perl interpreter.
From Poet::Mason:

----
my $instance;

method instance ($class:) {
    $instance ||= $class->new();
    $instance;
}
----

There is a singleton there, $instance. First app will set it with all
the configuration. All the others will reuse it.

I'm on the same boat BTW, I would like to run two apps on the same
starman. For now, I'm running multiple starman's, on different ports,
and have nginx frontend reverse proxying to each one.

The above code could be changed to

-----
my %instances;

method instance ($class:) {
    my $instance = $instances{$class} ||= $class->new();
    $instance;
}
----

It might work, but it is totally untested, I don't remember if there
are any other singleton's in there somewhere....

Eventually I'll have to tackle this, but I'm not sure if Jonathan is
willing to accept a pull request on this. So be prepared to keep your
private Poet tree if you really cannot have multiple starman's.

Bye,
-- 
Pedro Melo
@pedromelo
http://www.simplicidade.org/
http://about.me/melo
xmpp:m...@simplicidade.org
mailto:m...@simplicidade.org

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to