Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: users

Embedding Cherokee in a Lisp application...

 

 

Cherokee users RSS feed   Index | Next | Previous | View Threaded


mwkohout at gmail

Aug 16, 2009, 10:38 PM

Post #1 of 5 (345 views)
Permalink
Embedding Cherokee in a Lisp application...

Hello all-

At work, I use Cherokee as a traditional web server fronting a bunch of RoR
mongrel web apps and it's worked wonderfully.

But, at home I've been developing a Lisp based web application. What I was
hoping with this application is to essentially control Cherokee inside this
lisp app-
so the lisp application(via FFI) would start up Cherokee and set itself up
as a handler(at runtime).

I was wondering if this was possible and if so, if there was any
documentation on how to do this. Also, if anyone had any suggestions they
too would also be appreciated.

thanks
Mike


alvaro at octality

Aug 17, 2009, 12:28 PM

Post #2 of 5 (315 views)
Permalink
Re: Embedding Cherokee in a Lisp application... [In reply to]

On 17-ago-09, at 07:38, Michael Kohout wrote:

> But, at home I've been developing a Lisp based web application.
> What I was hoping with this application is to essentially control
> Cherokee inside this lisp app- so the lisp application(via FFI)
> would start up Cherokee and set itself up as a handler(at runtime).


It sounds kind of unusual, although I suppose you could do something
like this..

- Launching /usr/sbin/cherokee from the lisp app.
- Rewriting the configuration file, so you add an entry for your
handler.
- Perform a graceful restart by sending a HUP signal to the cherokee
PID.

After the graceful restart the configuration changes would already by
applied, and the server PID would remain being the same.

BTW, completely of curiosity, what do you want to do?

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


mwkohout at gmail

Aug 17, 2009, 1:02 PM

Post #3 of 5 (312 views)
Permalink
Re: Embedding Cherokee in a Lisp application... [In reply to]

Hmm...that's not quite what I'm hoping to do. I was hoping to interact with
Cherokee's c api to do all this. Much like you would for an embedded, in
process web server. A simple example of a server than can do this is
Mongoose <http://code.google.com/p/mongoose/>, which I would use, but I'd
like to use something that's has a larger user base and better support(enter
Cherokee).

thanks
Mike

On Mon, Aug 17, 2009 at 2:28 PM, Alvaro Lopez Ortega <alvaro [at] octality>wrote:

> On 17-ago-09, at 07:38, Michael Kohout wrote:
>
> But, at home I've been developing a Lisp based web application. What I
>> was hoping with this application is to essentially control Cherokee inside
>> this lisp app- so the lisp application(via FFI) would start up Cherokee and
>> set itself up as a handler(at runtime).
>>
>
>
> It sounds kind of unusual, although I suppose you could do something like
> this..
>
> - Launching /usr/sbin/cherokee from the lisp app.
> - Rewriting the configuration file, so you add an entry for your handler.
> - Perform a graceful restart by sending a HUP signal to the cherokee PID.
>
> After the graceful restart the configuration changes would already by
> applied, and the server PID would remain being the same.
>
> BTW, completely of curiosity, what do you want to do?
>
> --
> Octality
> http://www.octality.com/
>
>


alvaro at octality

Aug 17, 2009, 1:38 PM

Post #4 of 5 (312 views)
Permalink
Re: Embedding Cherokee in a Lisp application... [In reply to]

On 17-ago-09, at 22:02, Michael Kohout wrote:

> Hmm...that's not quite what I'm hoping to do. I was hoping to
> interact with Cherokee's c api to do all this. Much like you would
> for an embedded, in process web server.


Check cherokee/main.c and cherokee/main_admin.c source files, those
are the best resources to see how to embed the libcherokee-server
library.

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


mwkohout at gmail

Aug 17, 2009, 5:00 PM

Post #5 of 5 (309 views)
Permalink
Re: Embedding Cherokee in a Lisp application... [In reply to]

Awesome! Thanks so much.

I'm not much of a c developer, but main() in main_admin looks like it's
almost exactly what I need to emulate. The only thing I'm not sure of is a
way to pass a live function pointer as a request callback handler, rather
than build up an in-memory config file.

Is get_info/dylib_open in plugin_loader.c what I'm looking for?

On Mon, Aug 17, 2009 at 3:38 PM, Alvaro Lopez Ortega <alvaro [at] octality>wrote:

> On 17-ago-09, at 22:02, Michael Kohout wrote:
>
> Hmm...that's not quite what I'm hoping to do. I was hoping to interact
>> with Cherokee's c api to do all this. Much like you would for an embedded,
>> in process web server.
>>
>
>
> Check cherokee/main.c and cherokee/main_admin.c source files, those are the
> best resources to see how to embed the libcherokee-server library.
>
>
> --
> Octality
> http://www.octality.com/
>
>

Cherokee users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.