Struct puff_rs::python::PythonDispatcher
source · pub struct PythonDispatcher { /* private fields */ }
Implementations
sourceimpl PythonDispatcher
impl PythonDispatcher
pub fn new(
config: RuntimeConfig,
context_waiting: Arc<Mutex<Option<PuffContext>>>,
handle: Handle
) -> PyResult<Self>
sourcepub fn dispatch_blocking<A: IntoPy<Py<PyTuple>>, K: IntoPy<Py<PyDict>>>(
&self,
py: Python<'_>,
function: PyObject,
args: A,
kwargs: K
) -> PyResult<Receiver<PyResult<PyObject>>>
pub fn dispatch_blocking<A: IntoPy<Py<PyTuple>>, K: IntoPy<Py<PyDict>>>(
&self,
py: Python<'_>,
function: PyObject,
args: A,
kwargs: K
) -> PyResult<Receiver<PyResult<PyObject>>>
Run the python function a new Tokio blocking working thread.
sourcepub fn dispatch1<A: IntoPy<Py<PyTuple>> + Send + 'static>(
&self,
function: PyObject,
args: A
) -> PyResult<Receiver<PyResult<PyObject>>>
pub fn dispatch1<A: IntoPy<Py<PyTuple>> + Send + 'static>(
&self,
function: PyObject,
args: A
) -> PyResult<Receiver<PyResult<PyObject>>>
Acquires the GIL and Executes the python function on the greenlet thread or a new thread depending if greenlets were enabled. Takes no keyword arguments
sourcepub fn dispatch<A: IntoPy<Py<PyTuple>>, K: IntoPy<Py<PyDict>>>(
&self,
function: PyObject,
args: A,
kwargs: Option<K>
) -> PyResult<Receiver<PyResult<PyObject>>>
pub fn dispatch<A: IntoPy<Py<PyTuple>>, K: IntoPy<Py<PyDict>>>(
&self,
function: PyObject,
args: A,
kwargs: Option<K>
) -> PyResult<Receiver<PyResult<PyObject>>>
Acquires the GIL and Executes the python function on the greenlet thread or a new thread depending if greenlets were enabled.
sourcepub fn dispatch_greenlet<A: IntoPy<Py<PyTuple>>, K: IntoPy<Py<PyDict>>>(
&self,
py: Python<'_>,
function: PyObject,
args: A,
kwargs: K
) -> PyResult<Receiver<PyResult<PyObject>>>
pub fn dispatch_greenlet<A: IntoPy<Py<PyTuple>>, K: IntoPy<Py<PyDict>>>(
&self,
py: Python<'_>,
function: PyObject,
args: A,
kwargs: K
) -> PyResult<Receiver<PyResult<PyObject>>>
Executes the python function on the greenlet thread.
Trait Implementations
sourceimpl Clone for PythonDispatcher
impl Clone for PythonDispatcher
sourcefn clone(&self) -> PythonDispatcher
fn clone(&self) -> PythonDispatcher
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl !RefUnwindSafe for PythonDispatcher
impl Send for PythonDispatcher
impl Sync for PythonDispatcher
impl Unpin for PythonDispatcher
impl UnwindSafe for PythonDispatcher
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more