librelist archives

« back to archive

Fwd: Re: Photon

Fwd: Re: Photon

From:
Loic d'Anterroches
Date:
2011-09-15 @ 13:20
Forwarded to the list, now I need to answer :)

-------- Original Message --------
Subject: 	Re: Photon
Date: 	Tue, 6 Sep 2011 00:06:24 +0300
From: 	Eldad Yamin <eldad87@gmail.com>


I will send my questions to the mailing list.

I tried to install photon using the instillation guide.
when I got to "hnu selftest" I got fatal error, the error was about
missing file (something like 0MQ Context.php - I'll need to check what
file was it tomorrow when I'll get to work).

In addition, I'm interesting in using it for developing game-server so I
have some questions:
Is photon production-ready?
When Mongrel2 will reset the application (500 run times by default) -
can I ask the server to not clear all the memory and keep some variables
in memory?
Is there a way to use photon from source and not as
the instillation guide instruct? in other words, I want to download the
photon source, 0MQ php source or install the extension and run photon.
this will give me a much better understanding on how photon works/use
photon/develop photon.
I couldn't find documentation about the source and architecture, I want
to get a better understanding how it works in order to develop the
framework itself. can you provide me with some explanations?

Re: [photon.users] Fwd: Re: Photon

From:
Loic d'Anterroches
Date:
2011-09-20 @ 07:33
Hello,

> I tried to install photon using the instillation guide.
> when I got to "hnu selftest" I got fatal error, the error was about
> missing file (something like 0MQ Context.php - I'll need to check what
> file was it tomorrow when I'll get to work).

You need first to install the 0MQ extension.

> In addition, I'm interesting in using it for developing game-server so I
> have some questions:
> Is photon production-ready?

Yes. Why, because it is extremely simple, this means the code is
extremely easy to debug and fix in case of issues. The goal of Photon is
just to provide the PHP level dispatching of the requests, so you can
reuse all the code of your other projects easily.

> When Mongrel2 will reset the application (500 run times by default) -
> can I ask the server to not clear all the memory and keep some variables
> in memory?

Mongrel2 will never reset the application. They are totally independent
and only communicate over 0MQ. So yes, you can have a long running
background task storing some states. What you should do is simply dump
it on the disk some times to times to allow quick recovery if you move
the background task on another system or suffer a system restart.

> Is there a way to use photon from source and not as
> the instillation guide instruct? in other words, I want to download the
> photon source, 0MQ php source or install the extension and run photon.
> this will give me a much better understanding on how photon works/use
> photon/develop photon.

Yes, just clone the repository.

> I couldn't find documentation about the source and architecture, I want
> to get a better understanding how it works in order to develop the
> framework itself. can you provide me with some explanations?

Take a look at the \photon\core namespace. You have there the
dispatching of the request after getting it from Mongrel2.
Take a look at \photon\mongrel2 for the way the request is read from the
Mongrel2 message and converted into a \photon\http\Request object.

loïc