/external/libcxx/test/std/thread/futures/futures.async/ |
async_race.38682.pass.cpp | 47 std::future<int> fut = std::async(std::launch::async, worker, v); local 48 int answer = fut.get(); 56 std::future<int&> fut = std::async(std::launch::async, worker_ref, std::ref(i)); local 57 int& answer = fut.get(); 65 std::future<void> fut = std::async(std::launch::async, worker_void); local 66 fut.get();
|
/external/python/cpython3/Lib/asyncio/ |
locks.py | 184 fut = self._loop.create_future() 185 self._waiters.append(fut) 192 await fut 194 self._waiters.remove(fut) 223 fut = next(iter(self._waiters)) 230 if not fut.done(): 231 fut.set_result(True) 270 for fut in self._waiters: 271 if not fut.done(): 272 fut.set_result(True [all...] |
tasks.py | 371 async def wait_for(fut, timeout, *, loop=None): 388 return await fut 391 fut = ensure_future(fut, loop=loop) 393 if fut.done(): 394 return fut.result() 396 fut.cancel() 403 fut = ensure_future(fut, loop=loop) 404 fut.add_done_callback(cb [all...] |
selector_events.py | 350 fut = self.create_future() 351 self._sock_recv(fut, None, sock, n) 352 return await fut 354 def _sock_recv(self, fut, registered_fd, sock, n): 363 if fut.cancelled(): 369 self.add_reader(fd, self._sock_recv, fut, fd, sock, n) 371 fut.set_exception(exc) 373 fut.set_result(data) 383 fut = self.create_future() 384 self._sock_recv_into(fut, None, sock, buf [all...] |
futures.py | 272 def _get_loop(fut): 276 get_loop = fut.get_loop 281 return fut._loop 284 def _set_result_unless_cancelled(fut, result): 286 if fut.cancelled(): 288 fut.set_result(result)
|
windows_events.py | 122 def _unregister_wait_cb(self, fut): 196 def _unregister_wait_cb(self, fut): 212 super()._unregister_wait_cb(fut) 418 fut = self._loop.create_future() 419 fut.set_result(value) 420 return fut 605 fut = self._wait_for_handle(event, None, True) 608 fut._done_callback = done_callback 609 return fut 769 for address, (fut, ov, obj, callback) in list(self._cache.items()) [all...] |
unix_events.py | 336 fut = self.create_future() 337 self._sock_sendfile_native_impl(fut, None, sock, fileno, 339 return await fut 341 def _sock_sendfile_native_impl(self, fut, registered_fd, sock, fileno, 350 if fut.cancelled(): 357 fut.set_result(total_sent) 364 self._sock_add_cancellation_callback(fut, sock) 365 self.add_writer(fd, self._sock_sendfile_native_impl, fut, 388 fut.set_exception(err) 391 fut.set_exception(exc [all...] |
proactor_events.py | 246 def _loop_reading(self, fut=None): 249 if fut is not None: 250 assert self._read_fut is fut or (self._read_fut is None and 253 if fut.done(): 255 data = fut.result() 258 fut.cancel() 412 def _pipe_closed(self, fut): 413 if fut.cancelled(): 416 assert fut.result() == b'' 420 assert fut is self._read_fut, (fut, self._read_fut [all...] |
base_events.py | 158 def _run_until_complete_cb(fut): 159 if not fut.cancelled(): 160 exc = fut.exception() 165 futures._get_loop(fut).stop() 197 fut = self._write_ready_fut 198 if fut is None: 200 await fut [all...] |
/external/python/cpython3/Modules/ |
_asynciomodule.c | 74 FutureObj_HEAD(fut) 198 get_future_loop(PyObject *fut) 206 if (Future_CheckExact(fut) || Task_CheckExact(fut)) { 207 PyObject *loop = ((FutureObj *)fut)->fut_loop; 212 if (_PyObject_LookupAttrId(fut, &PyId_get_loop, &getloop) < 0) { 221 return _PyObject_GetAttrId(fut, &PyId__loop); 381 future_is_alive(FutureObj *fut) 383 return fut->fut_loop != NULL; 388 future_ensure_alive(FutureObj *fut) 1461 FutureObj *fut = (FutureObj *)self; local 1517 FutureObj *fut = it->future; local 1787 PyObject *fut; local 2649 FutureObj *fut = (FutureObj*)result; local [all...] |
/external/python/cpython3/Lib/test/test_asyncio/ |
test_futures.py | 152 fut = self.cls.__new__(self.cls, loop=self.loop) 153 self.assertRaises(asyncio.InvalidStateError, fut.result) 155 fut = self.cls.__new__(self.cls, loop=self.loop) 156 self.assertRaises(asyncio.InvalidStateError, fut.exception) 158 fut = self.cls.__new__(self.cls, loop=self.loop) 160 fut.set_result(None) 162 fut = self.cls.__new__(self.cls, loop=self.loop) 164 fut.set_exception(Exception) 166 fut = self.cls.__new__(self.cls, loop=self.loop) 168 fut.cancel( 557 fut = self._new_future(loop=self.loop) variable in class:BaseFutureTests.test_future_del_collect.Evil [all...] |
test_windows_events.py | 116 fut = self.loop._proactor.wait_for_handle(event, 0.5) 118 done = self.loop.run_until_complete(fut) 122 self.assertFalse(fut.result()) 131 fut = self.loop._proactor.wait_for_handle(event, 10) 133 done = self.loop.run_until_complete(fut) 137 self.assertTrue(fut.result()) 142 fut.cancel() 150 fut = self.loop._proactor.wait_for_handle(event, 10) 151 fut.cancel() 154 self.loop.run_until_complete(fut) [all...] |
test_tasks.py | 114 fut = self.new_future(other_loop) 116 async def run(fut): 117 await fut 122 self.loop.run_until_complete(run(fut)) 228 fut = asyncio.ensure_future(Aw(coro()), loop=loop) 229 loop.run_until_complete(fut) 230 assert fut.result() == 'ok' 381 async def wait_for(fut): 382 return await fut 384 fut = self.new_future(self.loop [all...] |
test_proactor_events.py | 46 fut = asyncio.Future(loop=self.loop) 47 tr = self.socket_transport(waiter=fut) 49 self.assertIsNone(fut.result()) 181 fut = asyncio.Future(loop=self.loop) 182 fut.set_result(b'data') 185 tr._write_fut = fut 186 tr._loop_writing(fut) 190 fut = asyncio.Future(loop=self.loop) 191 fut.set_result(1) 194 tr._write_fut = fut [all...] |
test_base_events.py | 288 def check_in_thread(loop, event, debug, create_loop, fut): 304 loop.call_soon_threadsafe(fut.set_exception, exc) 306 loop.call_soon_threadsafe(fut.set_result, None) 310 fut = asyncio.Future(loop=loop) 312 args = (loop, event, debug, create_loop, fut) 315 loop.run_until_complete(fut) 562 def zero_error(fut): 563 fut.set_result(True) 568 fut = asyncio.Future(loop=self.loop) 569 self.loop.call_soon(zero_error, fut) [all...] |
test_unix_events.py | 434 self.fut = loop.create_future() 448 self.fut.set_result(None) 451 await self.fut 545 fut = self.loop.create_future() 547 self.loop._sock_sendfile_native_impl(fut, None, sock, fileno, 549 fut.cancel() 551 self.run_loop(fut) 558 fut = self.loop.create_future() 560 self.loop._sock_sendfile_native_impl(fut, None, sock, fileno, 562 fut.cancel( [all...] |
test_subprocess.py | 493 fut = asyncio.create_subprocess_exec( 498 process = await fut
|
test_selector_events.py | 210 fut = self.loop.create_task( 226 self.assertIsInstance(fut.exception(), OSError) 305 fut = self.loop.create_task(self.loop.sock_sendall(sock, b'data')) 320 self.assertIsInstance(fut.exception(), OSError) 426 fut = self.loop.create_task( 434 fut.cancel() 436 self.loop.run_until_complete(fut) [all...] |
test_events.py | [all...] |
/external/nanohttpd/websocket/src/test/java/fi/iki/elonen/samples/echo/ |
SimpleEchoSocket.java | 87 Future<Void> fut; local 90 fut = session.getRemote().sendStringByFuture(message); 91 fut.get(5, TimeUnit.SECONDS);
|
/external/python/cpython3/Lib/test/ |
test_asyncgen.py | 27 fut = coro.throw(AwaitException) 29 fut = coro.send(None) 33 if fut == ('throw',): 573 fut = asyncio.Future(loop=self.loop) 579 await fut 601 fut.cancel() 777 fut = asyncio.ensure_future(asyncio.sleep(delay, loop=self.loop), 779 self.loop.call_later(delay / 2, lambda: fut.cancel()) 780 return await fut 867 fut = asyncio.ensure_future(asyncio.sleep(delay, loop=self.loop) [all...] |
test_concurrent_futures.py | 755 for fut in futures: 756 self.assertRaises(BrokenProcessPool, fut.result) [all...] |
test_types.py | [all...] |
/external/python/cpython3/Lib/distutils/command/ |
build_ext.py | 467 for ext, fut in zip(self.extensions, futures): 469 fut.result()
|