ledgetech/lua-resty-qless

No hello world example?

gittyup2018 opened this issue · 3 comments

Can you create a working example? with a working nginx conf, worker template, etc.

The instructions are all over the place and probably the worst I've probably ever seen - I and others should not have to spend hours "trying" to make this code work, it should have a working example skeleton with the possibility to extend:

local queue = qless.queues['testing']

-- Let's add a job, with some data. Returns Job ID
local jid = queue:put("my.test.job", { hello = "howdy" })
-- = "0c53b0404c56012f69fa482a1427ab7d"

Easy enough to understand, now why is this here?

-- Now we can ask for a job
local job = queue:pop()

Are you asking for the job that you just created or is this supposed to go in the worker?

Does put() automatically enqueue or is job:perform required?

I have an init_worker_by_lua setup in my nginx.conf but the worker is never called and

-- And we can do the work associated with it!
job:perform()

Also, the example is not even consistent:

local queue = qless.queues['testing']

This calls "testing" queue apparently

But in your other example it

So if someone copies and pastes the codes (which is pretty typical with instructions) your instructions don't even work correctly.

There is not even any error code when a job fails or completes or anything. The only way to know if it code is running at all is to watch redis's log.

Also, I'm not sure what config options are this error refers to:

88#188: *6663 lua entry thread aborted: runtime error: /usr/local/openresty/site/lualib/resty/qless/worker.lua:72: bad argument #1 to 'ipairs' (table expected, got string)
stack traceback:
coroutine 0:
[C]: in function 'ipairs'
/usr/local/openresty/site/lualib/resty/qless/worker.lua:72: in function </usr/local/openresty/site/lualib/resty/qless/worker.lua:45>, context: ngx.timer

As again I simply copied/pasted your "instructions" or inconsistent code snippets, rather.

Apparently someone else asked for a working example in 2018 and you didn't even reply or acknowledge it.

I've never used your code before and was planning on http module as well, but if this is the way you do things and the effort you put in your projects makes me verrrry worried to use them.

PRs are welcome

LOL Is that really your response? how is anyone supposed to make a PR when your example snippets don't even work and not documented correctly? I tell you it doesn't work and for some reason that makes you think I'm qualified to make a PR?

It's a good thing you don't hire people for a hospital..hey, random guy off the street. Want to perform this surgery? wow..well I'm definitely not using this library with "logic" like that, thanks for making me find/make an alternative.

If I was hiring for a hospital I'd probably getting paid for my time.
I'd still not be too interested in a random passer by issuing demands either

If you'd like to create a new issue in a more constructive manner then someone may choose to take time out of their day to make some improvements.

Until then you are welcome to use or not use any of this code as much or as little as you like.