umegaya / pulpo

multi-thread network server library build with coroutine and luajit FFI at ground level
7 stars 2 forks source link

Umegaya/feature/lazy require #16

Closed umegaya closed 10 years ago

umegaya commented 10 years ago

pulpo's initialization is really complex. one reason is, to archive faster cdef compilation with multi-thread environment, some module can be required only after thread module initialization finished.

so, sometimes requiring module on the top of each source code is impossible because in that timing, thread modules are not initialized.

then some modules are required on the fly (e.g. inside another function), that makes pulpo initialization process hard to read.

so I implement new package system for pulpo that enables first only returns module's table itself, after lazy loader adds actual API to that table.