Folly Futures to Python Asyncio Futures Bridge
authorJason Fried <fried@fb.com>
Mon, 20 Mar 2017 18:48:49 +0000 (11:48 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 20 Mar 2017 18:51:43 +0000 (11:51 -0700)
commit1d3ca26b6dd5e42d56f97c7b8ce20bbf21bf162e
tree33997bfe70026f016d8624f412cc4a6668ef0415
parent5d9dbb73c161a0c9d3f4b3d7275350c16969ae24
Folly Futures to Python Asyncio Futures Bridge

Summary:
folly/python/futures.h provides some helper functions for bridging folly::future to asyncio.Future.

folly/python/NotificationQueueExecutor.h is a Driveable executor that has a fileno() method that can be monitored using (select, epoll) to determine if the drive method should be called.

folly/python/executor.pyx is an implementation of a "driver" for the NotificationQueueExecutor from the python asyncio side. It tracks also keeps track of asyncio eventloops to Executor mappings.

the getExecutor() from folly/python/futures.h uses that mapping to return the correct executor for this python thread.

Reviewed By: andriigrynenko, yfeldblum

Differential Revision: D4687029

fbshipit-source-id: e79314606ffa18cb6933fe6b749991bfea646cde
folly/python/NotificationQueueExecutor.h [new file with mode: 0644]
folly/python/__init__.pxd [new file with mode: 0644]
folly/python/executor.pxd [new file with mode: 0644]
folly/python/executor.pyx [new file with mode: 0644]
folly/python/futures.h [new file with mode: 0644]
folly/python/futures.pxd [new file with mode: 0644]
folly/python/test/futures.py [new file with mode: 0644]
folly/python/test/simple.h [new file with mode: 0644]
folly/python/test/simplebridge.pyx [new file with mode: 0644]