Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'timer' not found when using TimeoutScheduler:schedule #29

Open
xtofl opened this issue Sep 11, 2018 · 3 comments
Open

module 'timer' not found when using TimeoutScheduler:schedule #29

xtofl opened this issue Sep 11, 2018 · 3 comments

Comments

@xtofl
Copy link

xtofl commented Sep 11, 2018

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'
...
@bjornbytes
Copy link
Owner

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

@bjornbytes
Copy link
Owner

We could add it as a lit dependency like this.

@xtofl
Copy link
Author

xtofl commented Sep 12, 2018

Thanks! That explains it. I read over it - silly. Shall I add it to the dependencies in the rockspec?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants