-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Queue | ||
===== | ||
|
||
.. automodule:: uwsgiconf.options.queue | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from uwsgiconf import Section | ||
|
||
|
||
def test_queue_basics(assert_lines): | ||
|
||
assert_lines([ | ||
'queue = 100', | ||
'queue-blocksize = 131072', | ||
], Section().queue.enable(100, block_size=131072)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from ..base import OptionsGroup | ||
|
||
|
||
class Queue(OptionsGroup): | ||
"""Queue. | ||
At the low level it is a simple block-based shared array, | ||
with two optional counters, one for stack-style, LIFO usage, | ||
the other one for FIFO. | ||
http://uwsgi-docs.readthedocs.io/en/latest/Queue.html | ||
""" | ||
|
||
def enable(self, size, block_size=None, store=None, store_sync_interval=None): | ||
"""Enables shared queue of the given size. | ||
:param int size: Queue size. | ||
:param int block_size: Block size in bytes. Default: 8 KiB. | ||
:param str|unicode store: Persist the queue into file. | ||
:param int store_sync_interval: Store sync interval in master cycles (usually seconds). | ||
""" | ||
self._set('queue', size) | ||
self._set('queue-blocksize', block_size) | ||
self._set('queue-store', store) | ||
self._set('queue-store-sync', store_sync_interval) | ||
|
||
return self._section |