Python queue

From wikinotes
Revision as of 00:52, 15 September 2019 by Will (talk | contribs) (Created page with "{{ NOTE | I've ran into strange bugs when not using <code>multiprocesing.queue</code> }} = Usage = <blockquote> Queues support both primitive objects and your own custom obje...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

NOTE:

I've ran into strange bugs when not using multiprocesing.queue

Usage

Queues support both primitive objects and your own custom objects. I have found the command pattern to be particularly useful when using queues.

import multiprocessing

queue = multiprocessing.Queue()

queue.put('a')
queue.get()  # blocks until an item is available.
#> 'a'