lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> That said, the libevent dependancy isn't easily dropped (read: large
> amounts of code would need to be rewritten) and even then I can't
> imagine being able to completely avoid libraries/C code since CGI isn't
> going to let routing happen.

I agree; I was only thinking about doing just enough using copas and
some HTTP handling code to allow your request/response API to work.

I looked at libevent HTTP support
(https://github.com/libevent/libevent/blob/master/http.c) and wouldn't
want to re-implement those 5k lines of code, but how much of that API
is needed to get your examples running? It seems like if these are
implemented in Lua, it should be possible to use flea without any
modifications, no?

	{ "write", request_write },
	{ "clear", request_clear },
	{ "getHeader", request_getHeader },
	{ "addHeader", request_addHeader },
	{ "clearHeaders", request_clearHeaders },
	{ "postData", request_postData },
	{ "sendFile", request_sendFile },
	{ "send", request_send },

Paul.

On Sat, Dec 1, 2012 at 3:35 PM, Michael Savage <mikejsavage@gmail.com> wrote:
> On Sat, Dec 01, 2012 at 02:54:08PM -0800, Paul K wrote:
>> Hi Michael,
>>
>> Looks very interesting. Any chance you can make it to work in a
>> Lua-only setup? For example, if I don't need Pluto to save coroutine
>> state and just need a single instance for local testing/debugging?
>>
>> Paul.
>
> It doesn't actually use pluto at all yet and the lfs dependancy can be
> avoided by running it in testing mode all the time (this will be
> slower though as it has to reread all the page/template files every time
> you use them). lua-cjson can be ditched as well just by swapping it for
> a pure Lua json lib.
>
> That said, the libevent dependancy isn't easily dropped (read: large
> amounts of code would need to be rewritten) and even then I can't
> imagine being able to completely avoid libraries/C code since CGI isn't
> going to let routing happen.
>
> Hope that helps,
> Mike
>