Home
last modified time | relevance | path

Searched refs:fut (Results 1 – 25 of 118) sorted by relevance

12345

/external/rust/crates/tokio-stream/tests/
Dstream_collect.rs46 let mut fut = task::spawn(rx.collect::<Vec<i32>>()); in collect_vec_items() localVariable
48 assert_pending!(fut.poll()); in collect_vec_items()
51 assert!(fut.is_woken()); in collect_vec_items()
52 assert_pending!(fut.poll()); in collect_vec_items()
55 assert!(fut.is_woken()); in collect_vec_items()
56 assert_pending!(fut.poll()); in collect_vec_items()
59 assert!(fut.is_woken()); in collect_vec_items()
60 let coll = assert_ready!(fut.poll()); in collect_vec_items()
68 let mut fut = task::spawn(rx.collect::<String>()); in collect_string_items() localVariable
70 assert_pending!(fut.poll()); in collect_string_items()
[all …]
/external/python/cpython3/Modules/
D_asynciomodule.c78 FutureObj_HEAD(fut)
202 get_future_loop(PyObject *fut) in get_future_loop() argument
210 if (Future_CheckExact(fut) || Task_CheckExact(fut)) { in get_future_loop()
211 PyObject *loop = ((FutureObj *)fut)->fut_loop; in get_future_loop()
216 if (_PyObject_LookupAttrId(fut, &PyId_get_loop, &getloop) < 0) { in get_future_loop()
225 return _PyObject_GetAttrId(fut, &PyId__loop); in get_future_loop()
392 future_is_alive(FutureObj *fut) in future_is_alive() argument
394 return fut->fut_loop != NULL; in future_is_alive()
399 future_ensure_alive(FutureObj *fut) in future_ensure_alive() argument
401 if (!future_is_alive(fut)) { in future_ensure_alive()
[all …]
/external/rust/crates/tokio/tests/
Dtime_timeout.rs14 let mut fut = task::spawn(timeout_at(Instant::now(), async {})); in simultaneous_deadline_future_completion() localVariable
17 assert_ready_ok!(fut.poll()); in simultaneous_deadline_future_completion()
23 let mut fut = task::spawn(timeout_at(Instant::now() - ms(1000), async {})); in completed_future_past_deadline() localVariable
26 assert_ready_ok!(fut.poll()); in completed_future_past_deadline()
37 let mut fut = task::spawn(timeout_at(Instant::now() + ms(100), rx)); in future_and_deadline_in_future() localVariable
39 assert_pending!(fut.poll()); in future_and_deadline_in_future()
44 assert_pending!(fut.poll()); in future_and_deadline_in_future()
48 assert!(fut.is_woken()); in future_and_deadline_in_future()
50 assert_ready_ok!(fut.poll()).unwrap(); in future_and_deadline_in_future()
61 let mut fut = task::spawn(timeout(ms(100), rx)); in future_and_timeout_in_future() localVariable
[all …]
Dmacros_join.rs60 let fut = async { in join_size() localVariable
64 assert_eq!(mem::size_of_val(&fut), 16); in join_size()
66 let fut = async { in join_size() localVariable
71 assert_eq!(mem::size_of_val(&fut), 28); in join_size()
/external/python/cpython3/Lib/asyncio/
Dlocks.py112 fut = self._loop.create_future()
113 self._waiters.append(fut)
120 await fut
122 self._waiters.remove(fut)
153 fut = next(iter(self._waiters))
160 if not fut.done():
161 fut.set_result(True)
203 for fut in self._waiters:
204 if not fut.done():
205 fut.set_result(True)
[all …]
Dtasks.py421 async def wait_for(fut, timeout, *, loop=None): argument
442 return await fut
445 fut = ensure_future(fut, loop=loop)
447 if fut.done():
448 return fut.result()
450 await _cancel_and_wait(fut, loop=loop)
452 fut.result()
462 fut = ensure_future(fut, loop=loop)
463 fut.add_done_callback(cb)
470 if fut.done():
[all …]
Dselector_events.py367 fut = self.create_future()
370 handle = self._add_reader(fd, self._sock_recv, fut, sock, n)
371 fut.add_done_callback(
373 return await fut
375 def _sock_read_done(self, fd, fut, handle=None): argument
379 def _sock_recv(self, fut, sock, n): argument
382 if fut.done():
391 fut.set_exception(exc)
393 fut.set_result(data)
408 fut = self.create_future()
[all …]
Dproactor_events.py271 def _loop_reading(self, fut=None): argument
274 if fut is not None:
275 assert self._read_fut is fut or (self._read_fut is None and
278 if fut.done():
280 data = fut.result()
283 fut.cancel()
437 def _pipe_closed(self, fut): argument
438 if fut.cancelled():
441 assert fut.result() == b''
445 assert fut is self._read_fut, (fut, self._read_fut)
[all …]
Dwindows_events.py123 def _unregister_wait_cb(self, fut): argument
197 def _unregister_wait_cb(self, fut): argument
213 super()._unregister_wait_cb(fut)
440 fut = self._loop.create_future()
441 fut.set_result(value)
442 return fut
581 fut = self._loop.create_future()
582 fut.set_result(None)
583 return fut
673 fut = self._wait_for_handle(event, None, True)
[all …]
/external/python/cpython3/Lib/test/test_asyncio/
Dtest_futures.py156 fut = self.cls.__new__(self.cls, loop=self.loop)
157 self.assertRaises(asyncio.InvalidStateError, fut.result)
159 fut = self.cls.__new__(self.cls, loop=self.loop)
160 self.assertRaises(asyncio.InvalidStateError, fut.exception)
162 fut = self.cls.__new__(self.cls, loop=self.loop)
164 fut.set_result(None)
166 fut = self.cls.__new__(self.cls, loop=self.loop)
168 fut.set_exception(Exception)
170 fut = self.cls.__new__(self.cls, loop=self.loop)
172 fut.cancel()
[all …]
Dtest_windows_events.py166 fut = self.loop._proactor.wait_for_handle(event, 0.5)
168 done = self.loop.run_until_complete(fut)
172 self.assertFalse(fut.result())
181 fut = self.loop._proactor.wait_for_handle(event, 10)
183 done = self.loop.run_until_complete(fut)
187 self.assertTrue(fut.result())
192 fut.cancel()
200 fut = self.loop._proactor.wait_for_handle(event, 10)
201 fut.cancel()
204 self.loop.run_until_complete(fut)
[all …]
Dtest_tasks.py162 fut = self.new_future(other_loop)
164 async def run(fut): argument
165 await fut
170 self.loop.run_until_complete(run(fut))
276 fut = asyncio.ensure_future(Aw(coro()), loop=loop)
277 loop.run_until_complete(fut)
278 assert fut.result() == 'ok'
464 async def wait_for(fut): argument
465 return await fut
467 fut = self.new_future(self.loop)
[all …]
Dtest_proactor_events.py51 fut = self.loop.create_future()
52 tr = self.socket_transport(waiter=fut)
54 self.assertIsNone(fut.result())
186 fut = self.loop.create_future()
187 fut.set_result(b'data')
190 tr._write_fut = fut
191 tr._loop_writing(fut)
195 fut = self.loop.create_future()
196 fut.set_result(1)
199 tr._write_fut = fut
[all …]
/external/python/cpython3/Lib/unittest/
Dasync_case.py78 fut = self._asyncioTestLoop.create_future()
79 self._asyncioCallsQueue.put_nowait((fut, ret))
80 return self._asyncioTestLoop.run_until_complete(fut)
86 fut = self._asyncioTestLoop.create_future()
87 self._asyncioCallsQueue.put_nowait((fut, ret))
88 return self._asyncioTestLoop.run_until_complete(fut)
92 async def _asyncioLoopRunner(self, fut): argument
94 fut.set_result(None)
100 fut, awaitable = query
103 if not fut.cancelled():
[all …]
/external/rust/crates/tokio/src/macros/
Dtry_join.rs86 let ( $($skip,)* fut, .. ) = &mut futures;
90 let mut fut = unsafe { Pin::new_unchecked(fut) }; localVariable
93 if fut.as_mut().poll(cx).is_pending() {
95 } else if fut.as_mut().output_mut().expect("expected completed future").is_err() {
96 … return Ready(Err(fut.take_output().expect("expected completed future").err().unwrap()))
105 let ( $($skip,)* fut, .. ) = &mut futures;
109 let mut fut = unsafe { Pin::new_unchecked(fut) }; localVariable
111 fut
Djoin.rs79 let ( $($skip,)* fut, .. ) = &mut futures;
83 let mut fut = unsafe { Pin::new_unchecked(fut) }; localVariable
86 if fut.poll(cx).is_pending() {
96 let ( $($skip,)* fut, .. ) = &mut futures;
100 let mut fut = unsafe { Pin::new_unchecked(fut) }; localVariable
102 fut.take_output().expect("expected completed future")
/external/rust/crates/futures-util/src/stream/stream/
Dtake_until.rs22 fut: Option<Fut>,
39 .field("fut", &self.fut) in fmt()
49 pub(super) fn new(stream: St, fut: Fut) -> Self { in new()
52 fut: Some(fut), in new()
65 if self.fut.is_some() { in take_future()
69 self.fut.take() in take_future()
115 !self.free && self.fut.is_none() in is_stopped()
129 if let Some(f) = this.fut.as_mut().as_pin_mut() { in poll_next()
131 this.fut.set(None); in poll_next()
136 if !*this.free && this.fut.is_none() { in poll_next()
[all …]
/external/rust/crates/futures/tests/
Dasync_await_macros.rs25 let fut = async { in join() localVariable
31 pin_mut!(fut); in join()
32 assert_eq!(Poll::Pending, poll!(&mut fut)); in join()
34 assert_eq!(Poll::Pending, poll!(&mut fut)); in join()
36 assert_eq!(Poll::Ready(()), poll!(&mut fut)); in join()
191 let fut = async { in select_size() localVariable
197 assert_eq!(::std::mem::size_of_val(&fut), 24); in select_size()
199 let fut = async { in select_size() localVariable
207 assert_eq!(::std::mem::size_of_val(&fut), 40); in select_size()
265 let fut = async { in select_on_non_unpin_size() localVariable
[all …]
Dstream_select_next_some.rs42 let mut fut = future::ready(1).pending_once(); in select() localVariable
47 num = fut => { in select()
75 let mut fut = future::ready(1).pending_once(); in futures_util_select() localVariable
80 num = fut => { in futures_util_select()
/external/rust/crates/futures-macro/src/
Djoin.rs61 let poll_futures = future_names.iter().map(|fut| { in join()
64 unsafe { __futures_crate::Pin::new_unchecked(&mut #fut) }, __cx).is_ready(); in join()
67 let take_outputs = future_names.iter().map(|fut| { in join()
69 unsafe { __futures_crate::Pin::new_unchecked(&mut #fut) }.take_output().unwrap(), in join()
99 let poll_futures = future_names.iter().map(|fut| { in try_join()
102 unsafe { __futures_crate::Pin::new_unchecked(&mut #fut) }, __cx).is_pending() in try_join()
105 …} else if unsafe { __futures_crate::Pin::new_unchecked(&mut #fut) }.output_mut().unwrap().is_err()… in try_join()
112 … unsafe { __futures_crate::Pin::new_unchecked(&mut #fut) }.take_output().unwrap().err().unwrap() in try_join()
118 let take_outputs = future_names.iter().map(|fut| { in try_join()
124 … unsafe { __futures_crate::Pin::new_unchecked(&mut #fut) }.take_output().unwrap().ok().unwrap(), in try_join()
/external/libcxx/test/std/thread/futures/futures.async/
Dasync_race.38682.pass.cpp47 std::future<int> fut = std::async(std::launch::async, worker, v); in main() local
48 int answer = fut.get(); in main()
56 std::future<int&> fut = std::async(std::launch::async, worker_ref, std::ref(i)); in main() local
57 int& answer = fut.get(); in main()
65 std::future<void> fut = std::async(std::launch::async, worker_void); in main() local
66 fut.get(); in main()
/external/llvm-project/libcxx/test/std/thread/futures/futures.async/
Dasync_race.38682.pass.cpp46 std::future<int> fut = std::async(std::launch::async, worker, v); in main() local
47 int answer = fut.get(); in main()
55 std::future<int&> fut = std::async(std::launch::async, worker_ref, std::ref(i)); in main() local
56 int& answer = fut.get(); in main()
64 std::future<void> fut = std::async(std::launch::async, worker_void); in main() local
65 fut.get(); in main()
/external/llvm-project/lldb/third_party/Python/module/pexpect-4.6/pexpect/
D_async.py27 return (yield from asyncio.wait_for(pw.fut, timeout))
38 self.fut = asyncio.Future()
41 if not self.fut.done():
42 self.fut.set_result(result)
46 if not self.fut.done():
47 self.fut.set_exception(exc)
58 if self.fut.done():
/external/rust/crates/futures-util/src/stream/try_stream/
Dtry_unfold.rs67 fut: None, in try_unfold()
78 fut: Option<Fut>,
90 .field("fut", &self.fut) in fmt()
109 this.fut.set(Some((this.f)(state))); in poll_next()
112 match this.fut.as_mut().as_pin_mut() { in poll_next()
119 this.fut.set(None); in poll_next()
/external/rust/crates/async-trait/tests/executor/
Dmod.rs8 pub fn block_on_simple<F: Future>(mut fut: F) -> F::Output { in block_on_simple()
30 let fut = unsafe { Pin::new_unchecked(&mut fut) }; in block_on_simple() localVariable
32 match fut.poll(&mut cx) { in block_on_simple()

12345