-
Notifications
You must be signed in to change notification settings - Fork 50
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
Priority queue #186
Comments
Yes Please. I really need this too. @ancieg did you find anything? |
I am planning to add this in next week, can you explain the use case for your scenario? |
Wow. That's great. My use case is for multiple data streams coming from a sensor that goes into python and needs to be stored (sorted by timestamp) and then retrieved for a server request. The priority queue allows me to have those streams be sorted at the time of insertion |
@AGandhiCraniUS If you want a Timestamp based priority queue, you can try def test_open_close_1000(self):
"""Write 1000 items, close, reopen checking if all items are there"""
q = FILOSQLiteQueue(self.path, auto_commit=self.auto_commit)
for i in range(1000):
q.put('var%d' % i)
self.assertEqual(1000, q.qsize())
del q
q = FILOSQLiteQueue(self.path)
self.assertEqual(1000, q.qsize())
for i in range(1000):
data = q.get()
self.assertEqual('var%d' % (999 - i), data)
# assert adding another one still works
q.put('foobar')
data = q.get()
self.assertEqual('foobar', data) |
I haven't found any other active Python projects for managing persistent queues (only little-functional or nearly archived ones).
But this has a disadvantage (important for me) - it does not have priority queues.
I would be very happy if you add support for priority queues.
The text was updated successfully, but these errors were encountered: