tarantool / queue

Create task queues, add and take jobs, monitor failed tasks
Other
237 stars 52 forks source link

No way to check if tube exists without use of Eval iproto query. #58

Closed funny-falcon closed 7 years ago

funny-falcon commented 7 years ago

I don't like to call eval from client cause it needs to 'execute universe' privilege. But now there is no way neither check tube for existence nor create tube without using eval query. create_tube fails cause it returns table that could not be serialized to msgpack and sent to response. Without ability to call create_tube single way to check tube existence is eval('return queue.tube.myqueu ~= nil').

Please add ability to check tube existence without eval. And/or ability to create tube using iproto connector.

bigbes commented 7 years ago

You can try to call function 'take' + 'release' after. If it exists, then everything'll be ok.

Without ability to call create_tube

create_tube isn't something that should be called from outside of Tarantool. It's "administration request" and, so, you should use eval command to call it.

bigbes commented 7 years ago

If it related to something, that you're doing here, then I can tell you, that you're doing "overkill" version of connector for queue. You won't be able to completely rid of Lua language, so it's better to abandon Queue DDL from driver.

funny-falcon commented 7 years ago

I agree that creat_tube should not be called from client side but from configuration script or console.

Still check for existence is useful task, and take+release is a certainly wrong way to do it. There should be queue.exist(tube_name) which returns tube configuration if exists (so client may check type of queue), and return null if tube doesn't exist.