MCPcopy Index your code
hub / github.com/RustPython/RustPython / _asyncio_awaited_by

Method _asyncio_awaited_by

crates/stdlib/src/_asyncio.rs:704–720  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

702
703 #[pygetset]
704 fn _asyncio_awaited_by(&self, vm: &VirtualMachine) -> PyResult<PyObjectRef> {
705 let awaited_by = self.fut_awaited_by.read().clone();
706 match awaited_by {
707 None => Ok(vm.ctx.none()),
708 Some(obj) => {
709 if self.fut_awaited_by_is_set.load(Ordering::Relaxed) {
710 // Already a Set
711 Ok(obj)
712 } else {
713 // Single object - create a Set for the return value
714 let new_set = PySet::default().into_ref(&vm.ctx);
715 new_set.add(obj, vm)?;
716 Ok(new_set.into())
717 }
718 }
719 }
720 }
721
722 /// Add waiter to fut_awaited_by with single-object optimization
723 fn awaited_by_add(&self, waiter: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 6

noneMethod · 0.80
cloneMethod · 0.45
readMethod · 0.45
loadMethod · 0.45
into_refMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected