Created
February 11, 2011 03:52
-
-
Save metachris/821889 to your computer and use it in GitHub Desktop.
Adds example usage to help(multiprocessing.reduction)
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 patch for multiprocessing/reduction.py adds example usage to | |
# help(multiprocessing.reduction) | |
# | |
# Compatible with Python 2.6, 2.7 and 3.1. | |
# | |
6a7,20 | |
> # Example usage: | |
> # | |
> # # Main process | |
> # from multiprocessing.reduction import reduce_handle | |
> # h = reduce_handle(client_socket.fileno()) | |
> # pipe_to_worker.send(h) | |
> # | |
> # # Worker process | |
> # from multiprocessing.reduction import rebuild_handle | |
> # h = pipe.recv() | |
> # fd = rebuild_handle(h) | |
> # client_socket = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM) | |
> # client_socket.send("hello from the worker process\r\n") | |
> # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment