开发者

using pykestrel,the python library for the kestrel queue system

开发者 https://www.devze.com 2023-02-07 10:11 出处:网络
I am new to asynchronous message queues and would be using the python api to kestrel, pykestrel in my project (https://github.com/empower/pykestrel).

I am new to asynchronous message queues and would be using the python api to kestrel, pykestrel in my project (https://github.com/empower/pykestrel).

The example on the github page,has the following line:

q.add("test job")

What is test job in practice ?. Can someone please provide some more examples dem开发者_如何学JAVAonstrating the use of pykestrel ?

Please Help

Thank You


The code in your question adds a message to the Kestrel Queue.

kestrel.next()

will get the next message in the queue.

You can find full documentation in the code : https://github.com/empower/pykestrel/blob/master/kestrel/client.py

Also, kestrel uses the memcache protocol which you can find here : http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt

Basically, anything that works with Memcache can be used with Kestrel.


For posterity, note that the original project is at https://github.com/matterkkila/pykestrel/ and is newer.


"test job", in practice, is the description of the action to be done by your worker. For example, if you're a video site, once you receive a new video:

"MakeIcon('/path/to/video')"

Your worker process should know what to do based on that message. The message can be larger and contain more information.

It can be anything, encoded anyway you please.

0

精彩评论

暂无评论...
验证码 换一张
取 消