RxLua
RxLua copied to clipboard
module 'timer' not found when using `TimeoutScheduler:schedule`
TimeoutScheduler
depends on 'a' timer
module, which isn't mentioned in any dependency.
Reproduce:
luarocks install rxlua
lua
> rx = require('rx')
> s = rx.TimeoutScheduler.create()
> s:schedule(function() end, 1000)
lua: ... module 'timer' not found:
no field package.preload['timer']
no file '/usr/local/share/lua/5.3/timer.lua'
no file '/usr/local/share/lua/5.3/timer/init.lua'
...
The TimeoutScheduler only works when run within luvit. I'm not sure it would be possible to add that as a dependency using luarocks. This is mentioned in the docs, but maybe we could pcall and throw a better error so it's less confusing? Let me know if you have any other ideas
We could add it as a lit dependency like this.
Thanks! That explains it. I read over it - silly. Shall I add it to the dependencies in the rockspec?