reduce_shared

Function reduce_shared 

Source
pub fn reduce_shared<'py>(
    py: Python<'py>,
    py_shared: &Bound<'py, PyShared>,
) -> PyResult<(Bound<'py, PyAny>, Bound<'py, PyTuple>)>
Expand description

Reduce a PyShared for pickling.

This function implements the pickle protocol for PyShared:

  1. If the shared is already finished, return (Shared.from_value, (value,))
  2. If pending pickles are allowed, push it as a pending pickle and return (pop_pending_pickle, ())
  3. Otherwise, block on the shared and return (Shared.from_value, (value,))