Commit cf504d17 authored by Jason Fried's avatar Jason Fried Committed by Facebook Github Bot

Safer Clients

Summary:
Python is considered a Safe Enivronment, where things like aborts and segfaults
can not happen.

If clients where used outside of "async with" we use to print a error message
and then C++ would abort.

This fix makes sure C++ no longer aborts but we still print the message
that the "async with" should be used.

All futures are now shielded so cancel will not produce strange exceptions when
C++ decides to fullfill the canceled future.

Also we now pass a tuple of client and future to all bridgeFutureWith calls.
This has the affect of making sure the client can not GC before the future
is completed.

We now use a unique_ptr for RequestChannel so there is no more race to delete
the shared pointer.

Reviewed By: yfeldblum

Differential Revision: D7389380

fbshipit-source-id: 6a3ca019190907e726c550c9b379a2a2610d0b0a
parent 3daa8962
...@@ -13,7 +13,7 @@ cdef extern from "folly/Try.h" namespace "folly" nogil: ...@@ -13,7 +13,7 @@ cdef extern from "folly/Try.h" namespace "folly" nogil:
cdef extern from "folly/futures/Future.h" namespace "folly" nogil: cdef extern from "folly/futures/Future.h" namespace "folly" nogil:
cdef cppclass cFollyFuture "folly::Future"[T]: cdef cppclass cFollyFuture "folly::Future"[T]:
pass T get()
#TODO add via and then #TODO add via and then
cdef extern from "folly/Unit.h" namespace "folly": cdef extern from "folly/Unit.h" namespace "folly":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment