Blocking I/O is the default in most existing libraries, especially ones binding to C/C++ libraries. This is the reason that luvit 1.0 explicitly broke compatibility with lua's native require and luarocks.
I didn't want to face the problem of people accidentally pulling in some blocking dependency and then publishing benchmarks about how slow luvit is. I've since changed my mind and decided that it's not my job to prevent this kind of food gun. I give you the tools, do with them as you wish. On Wed, Aug 17, 2016 at 10:44 AM, Tim Caswell <[email protected]> wrote: > You can probably require it, but if the library makes blocking I/O calls, > it defeats the purpose of using a non-blocking event loop. Your server > will have a max concurrency of 1 as soon as you add any blocking calls into > the request handling. > > On Wed, Aug 17, 2016 at 6:08 AM, Dmitri Voronianski < > [email protected]> wrote: > >> Also is it possible to require lua modules like https://github.com/moai/l >> uamongo in luvit now? >> >> 2016-08-15 20:57 GMT+02:00 Tim Caswell <[email protected]>: >> >>> Yes, this is by design. The prefix in the lit namespace is the >>> publisher, not the package name. That way multiple people can publish >>> packages with the same name. Think of github forks. >>> >>> On Mon, Aug 15, 2016 at 10:23 AM, Dmitri Voronianski < >>> [email protected]> wrote: >>> >>>> I've published module to Lit with such package.lua: >>>> >>>> return { >>>> name = "voronianski/utopia", >>>> version = "1.0.0", >>>> description = "High performance middleware framework for Luvit.io", >>>> repository = { >>>> url = "http://github.com/luvitrocks/luvit-utopia.git", >>>> }, >>>> tags = {"utopia", "express", "connect", "middleware", "server"}, >>>> author = { >>>> name = "Dmitri Voronianski", >>>> email = "[email protected]" >>>> }, >>>> homepage = "https://github.com/luvitrocks/luvit-utopia", >>>> licenses = {"MIT"}, >>>> dependencies = {}, >>>> files = { >>>> "**.lua", >>>> "!test*" >>>> } >>>> } >>>> >>>> >>>> But when using it inside another I should require it like: >>>> >>>> local utopia = require('utopia') >>>> >>>> but not: >>>> >>>> local utopia = require('voronianski/utopia') >>>> >>>> is it by design? >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "luvit" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "luvit" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Best regards, >> >> *Dmitri Voronianski* >> >> -- >> You received this message because you are subscribed to the Google Groups >> "luvit" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "luvit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
