Home
last modified time | relevance | path

Searched full:async (Results 1 – 25 of 6259) sorted by relevance

12345678910>>...251

/external/python/cpython3/Lib/test/test_asyncio/
Dtest_taskgroups.py33 async def test_taskgroup_01(self):
35 async def foo1():
39 async def foo2():
43 async with taskgroups.TaskGroup() as g:
50 async def test_taskgroup_02(self):
52 async def foo1():
56 async def foo2():
60 async with taskgroups.TaskGroup() as g:
68 async def test_taskgroup_03(self):
70 async def foo1():
[all …]
Dtest_timeouts.py16 async def test_timeout_basic(self):
18 async with asyncio.timeout(0.01) as cm:
22 async def test_timeout_at_basic(self):
27 async with asyncio.timeout_at(deadline) as cm:
32 async def test_nested_timeouts(self):
37 async with asyncio.timeout_at(deadline) as cm1:
40 async with asyncio.timeout_at(deadline) as cm2:
49 async def test_waiter_cancelled(self):
52 async with asyncio.timeout(0.01):
60 async def test_timeout_not_called(self):
[all …]
Dtest_locks.py28 async def test_repr(self):
37 async def test_lock(self):
48 async def test_lock_doesnt_accept_loop_parameter(self):
67 async def test_lock_by_with_statement(self):
86 async def test_acquire(self):
92 async def c1(result):
97 async def c2(result):
102 async def c3(result):
137 async def test_acquire_cancel(self):
147 async def test_cancel_race(self):
[all …]
Dtest_waitfor.py24 async def run(self):
42 async def test_asyncio_wait_for_cancelled(self):
53 async def test_asyncio_wait_for_timeout(self):
63 async def test_wait_for_timeout_less_then_0_or_0_future_done(self):
74 async def test_wait_for_timeout_less_then_0_or_0_coroutine_do_not_started(self):
77 async def foo():
86 async def test_wait_for_timeout_less_then_0_or_0(self):
94 async def foo():
115 async def test_wait_for(self):
118 async def foo():
[all …]
/external/rust/android-crates-io/crates/tokio/tests/
Dmacros_select.rs18 async fn sync_one_lit_expr_comma() { in sync_one_lit_expr_comma()
20 foo = async { 1 } => foo, in sync_one_lit_expr_comma()
27 async fn no_branch_else_only() { in no_branch_else_only()
36 async fn no_branch_else_only_biased() { in no_branch_else_only_biased()
46 async fn nested_one() { in nested_one()
48 foo = async { 1 } => tokio::select! { in nested_one()
49 bar = async { foo } => bar, in nested_one()
57 async fn sync_one_lit_expr_no_comma() { in sync_one_lit_expr_no_comma()
59 foo = async { 1 } => foo in sync_one_lit_expr_no_comma()
66 async fn sync_one_lit_expr_block() { in sync_one_lit_expr_block()
[all …]
Dtask_local_set.rs26 async fn local_current_thread_scheduler() { in local_current_thread_scheduler()
28 .run_until(async { in local_current_thread_scheduler()
29 task::spawn_local(async {}).await.unwrap(); in local_current_thread_scheduler()
36 async fn local_threadpool() { in local_threadpool()
44 .run_until(async { in local_threadpool()
46 task::spawn_local(async { in local_threadpool()
57 async fn localset_future_threadpool() { in localset_future_threadpool()
65 local.spawn_local(async move { in localset_future_threadpool()
73 async fn localset_future_timers() { in localset_future_timers()
78 local.spawn_local(async move { in localset_future_timers()
[all …]
Dmacros_test.rs7 async fn test_macro_can_be_used_via_use() { in test_macro_can_be_used_via_use()
8 tokio::spawn(async {}).await.unwrap(); in test_macro_can_be_used_via_use()
12 async fn test_macro_is_resilient_to_shadowing() { in test_macro_is_resilient_to_shadowing()
13 tokio::spawn(async {}).await.unwrap(); in test_macro_is_resilient_to_shadowing()
19 pub async fn unused_braces_main() { println!("hello") } in unused_braces_main()
22 async fn unused_braces_test() { assert_eq!(1 + 1, 2) } in unused_braces_test()
34 async fn f(self) { in trait_method()
45 pub async fn issue_4175_main_1() -> ! { in issue_4175_main_1()
49 pub async fn issue_4175_main_2() -> std::io::Result<()> { in issue_4175_main_2()
54 pub async fn issue_4175_test() -> std::io::Result<()> { in issue_4175_test()
[all …]
/external/python/cpython3/Lib/test/
Dtest_coroutines.py36 async def asynciter(iterable):
93 """async def foo():
97 """async def foo():
101 """async def foo(a=await something()):
105 """async def foo(a:await something()):
109 """async def foo():
111 [i async for i in els]
114 """async def foo():
119 """async def foo():
122 async for b in els]
[all …]
Dtest_contextlib_async.py19 async def test_enter(self):
21 async def __aexit__(self, *args):
27 async with manager as context:
30 async def test_slots(self):
34 async def __aexit__(self, *args):
41 async def test_async_gen_propagates_generator_exit(self):
45 async def ctx():
48 async def gen():
49 async with ctx():
53 async for val in g:
[all …]
Dtest_asyncgen.py45 async def iterate():
47 async for i in gen:
66 raise TypeError(f'{iterator!r} is not an async iterator')
71 async def anext_impl():
88 code = '''async def foo():
93 with self.assertRaisesRegex(SyntaxError, 'yield from.*inside async'):
97 code = '''async def foo():
101 with self.assertRaisesRegex(SyntaxError, 'yield from.*inside async'):
105 code = '''async def foo():
111 with self.assertRaisesRegex(SyntaxError, 'return.*value.*async gen'):
[all …]
/external/rust/android-crates-io/crates/maybe-async/
DREADME.md1 # maybe-async
3 **Why bother writing similar code twice for blocking and async code?**
5 …ps://github.com/fMeow/maybe-async-rs/workflows/CI%20%28Linux%29/badge.svg?branch=main)](https://gi…
7 …test Version](https://img.shields.io/crates/v/maybe-async.svg)](https://crates.io/crates/maybe-asy…
8 [![maybe-async](https://docs.rs/maybe-async/badge.svg)](https://docs.rs/maybe-async)
10 When implementing both sync and async versions of API in a crate, most API
11 of the two version are almost the same except for some async/await keyword.
13 `maybe-async` help unifying async and sync implementation by **procedural
15 - Write async code with normal `async`, `await`, and let `maybe_async`
17 those `async` and `await` when you need a blocking code.
[all …]
DCHANGELOG.md5 ### [0.2.10](https://github.com/fMeow/maybe-async-rs/compare/v0.2.9...v0.2.10) (2024-02-22)
7 ### [0.2.9](https://github.com/fMeow/maybe-async-rs/compare/v0.2.8...v0.2.9) (2024-01-31)
12 * support `async fn` in traits ([282eb76](https://github.com/fMeow/maybe-async-rs/commit/282eb76c0b…
14 ### [0.2.8](https://github.com/fMeow/maybe-async-rs/compare/v0.2.7...v0.2.8) (2024-01-30)
16 ### [0.2.7](https://github.com/fMeow/maybe-async-rs/compare/v0.2.6...v0.2.7) (2023-02-01)
21 * allow `maybe_async` on static ([a08b112](https://github.com/fMeow/maybe-async-rs/commit/a08b11218…
26 * applying to pub(crate) trait fail ([8cf762f](https://github.com/fMeow/maybe-async-rs/commit/8cf76…
28 ### [0.2.6](https://github.com/guoli-lyu/maybe-async-rs/compare/v0.2.4...v0.2.6) (2021-05-28)
33 * remove async test if condition not match ([0089daa](https://github.com/guoli-lyu/maybe-async-rs/c…
34 * test is removed when is_sync ([377815a](https://github.com/guoli-lyu/maybe-async-rs/commit/377815…
[all …]
/external/rust/android-crates-io/crates/async-trait/tests/
Dtest.rs31 async fn selfvalue(self) in selfvalue()
37 async fn selfref(&self) {} in selfref()
39 async fn selfmut(&mut self) {} in selfmut()
41 async fn required() -> Self::Assoc; in required()
43 async fn elided_lifetime(_x: &str) {} in elided_lifetime()
45 async fn explicit_lifetime<'a>(_x: &'a str) {} in explicit_lifetime()
47 async fn generic_type_param<T: Send>(x: Box<T>) -> T { in generic_type_param()
51 async fn calls(&self) { in calls()
57 async fn calls_mut(&mut self) { in calls_mut()
68 async fn selfvalue(self) {} in selfvalue()
[all …]
/external/rust/android-crates-io/crates/maybe-async/src/
Dlib.rs1 //! **Why bother writing similar code twice for blocking and async code?**
3 …ps://github.com/fMeow/maybe-async-rs/workflows/CI%20%28Linux%29/badge.svg?branch=main)](https://gi…
5 …test Version](https://img.shields.io/crates/v/maybe-async.svg)](https://crates.io/crates/maybe-asy…
6 //! [![maybe-async](https://docs.rs/maybe-async/badge.svg)](https://docs.rs/maybe-async)
8 //! When implementing both sync and async versions of API in a crate, most API
9 //! of the two version are almost the same except for some async/await keyword.
11 //! `maybe-async` help unifying async and sync implementation by **procedural
13 //! - Write async code with normal `async`, `await`, and let `maybe_async`
15 //! those `async` and `await` when you need a blocking code.
16 //! - Switch between sync and async by toggling `is_sync` feature gate in
[all …]
/external/rust/android-crates-io/crates/maybe-async/tests/ui/
D02-must-be-async.rs7 async fn declare_async(&self); in declare_async()
9 async fn async_fn(&self) { in async_fn()
16 async fn declare_async_not_send(&self); in declare_async_not_send()
18 async fn async_fn_not_send(&self) { in async_fn_not_send()
27 async fn declare_async(&self); in declare_async()
29 async fn async_fn(&self) { in async_fn()
38 async fn declare_async(&self); in declare_async()
40 async fn async_fn(&self) { in async_fn()
49 async fn declare_async_afit(&self); in declare_async_afit()
51 async fn async_fn_afit(&self) { in async_fn_afit()
[all …]
D01-maybe-async.rs9 async fn declare_async(&self); in declare_async()
11 async fn async_fn(&self) { in async_fn()
20 async fn declare_async(&self); in declare_async()
22 async fn async_fn(&self) { in async_fn()
31 async fn declare_async(&self); in declare_async()
33 async fn async_fn(&self) { in async_fn()
42 async fn declare_async_afit(&self); in declare_async_afit()
44 async fn async_fn_afit(&self) { in async_fn_afit()
50 async fn async_fn() {} in async_fn()
53 pub async fn pub_async_fn() {} in pub_async_fn()
[all …]
/external/rust/android-crates-io/crates/async-trait/
DREADME.md1 Async trait methods
4 …ge/github-dtolnay/async--trait-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="2…
5 …img.shields.io/crates/v/async-trait.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](…
6 …ields.io/badge/docs.rs-async--trait-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" hei…
7 …s/workflow/status/dtolnay/async-trait/ci.yml?branch=master&style=for-the-badge" height="20">](http…
9 The stabilization of async functions in traits in Rust 1.75 did not include
10 support for using traits containing async functions as `dyn Trait`. Trying to
11 use dyn with an async trait produces the following error:
15 async fn f(&self);
36 2 | async fn f(&self);
[all …]
/external/mockito/src/test/java/org/mockitousage/verification/
DVerificationWithAfterTest.java31 import org.mockitoutil.async.AsyncTesting;
46 private AsyncTesting async = new AsyncTesting(); field in VerificationWithAfterTest
51 async.cleanUp(); in tearDown()
57 async.runAfter(10, callMock); in should_verify_with_after()
58 async.runAfter(1000, callMock); in should_verify_with_after()
67 async.runAfter(10, callMock); in should_verify_with_after_and_fail()
68 async.runAfter(40, callMock); in should_verify_with_after_and_fail()
84 async.runAfter(10, callMock); in should_verify_with_time_x()
85 async.runAfter(50, callMock); in should_verify_with_time_x()
86 async.runAfter(600, callMock); in should_verify_with_time_x()
[all …]
DVerificationInOrderWithTimeoutTest.java24 import org.mockitoutil.async.AsyncTesting;
33 private AsyncTesting async; field in VerificationInOrderWithTimeoutTest
37 async = new AsyncTesting(); in setUp()
42 async.cleanUp(); in tearDown()
62 async.runAfter(20, callMock(mock1, 'a')); in should_verify_in_order_with_timeout()
63 async.runAfter(50, callMock(mock1, 'c')); in should_verify_in_order_with_timeout()
64 async.runAfter(200, callMock(mock2, 'b')); in should_verify_in_order_with_timeout()
75 async.runAfter(20, callMock(mock1, 'a')); in should_verify_in_order_with_timeout_and_fail()
76 async.runAfter(100, callMock(mock2, 'b')); in should_verify_in_order_with_timeout_and_fail()
96 async.runAfter(20, callMock(mock1, 'a')); in should_verify_in_order_with_times_x()
[all …]
/external/grpc-grpc/src/python/grpcio_tests/tests_aio/unit/
Dserver_test.py111 async def _unary_unary(unused_request, unused_context):
114 async def _block_forever(self, unused_request, unused_context):
117 async def _block_briefly(self, unused_request, unused_context):
121 async def _unary_stream_async_gen(self, unused_request, unused_context):
125 async def _unary_stream_reader_writer(self, unused_request, context):
129 async def _unary_stream_evilly_mixed(self, unused_request, context):
134 async def _stream_unary_async_gen(self, request_iterator, unused_context):
136 async for request in request_iterator:
142 async def _stream_unary_reader_writer(self, unused_request, context):
147 async def _stream_unary_evilly_mixed(self, request_iterator, context):
[all …]
Dclient_unary_unary_interceptor_test.py39 async def setUp(self):
42 async def tearDown(self):
52 async def test_executed_right_order(self):
58 async def intercept_unary_unary(
67 async with aio.insecure_channel(
96 async def test_status_code_Ok(self):
103 async def intercept_unary_unary(
115 async with aio.insecure_channel(
129 async def test_add_timeout(self):
133 async def intercept_unary_unary(
[all …]
/external/python/cpython3/Lib/test/test_unittest/
Dtest_async_case.py22 async def __aenter__(self):
26 async def __aexit__(self, *exc_info):
33 async def __aexit__(self, *exc_info):
36 async def __aenter__(self):
71 async def asyncSetUp(self):
78 async def test_func(self):
85 async def asyncTearDown(self):
102 async def on_cleanup2(self):
112 async def on_cleanup4(self):
122 async def on_cleanup6(self):
[all …]
/external/python/pyee/tests/
Dtest_trio.py15 async def test_trio_emit():
20 async with TrioEventEmitter() as ee:
25 async def event_handler():
39 async def test_trio_once_emit():
44 async with TrioEventEmitter() as ee:
48 async def event_handler():
62 async def test_trio_error():
67 async with TrioEventEmitter() as ee:
71 async def event_handler():
75 async def handle_error(exc):
[all …]
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/
DAwaitTest.kt11 val d = async { in <lambda>()
16 val d2 = async { in <lambda>()
36 val d = async(start = CoroutineStart.LAZY) { in <lambda>()
40 val d2 = async(start = CoroutineStart.LAZY) { in <lambda>()
50 val d1 = async { 1L } in <lambda>()
51 val d2 = async { "" } in <lambda>()
52 val d3 = async { } in <lambda>()
62 val d = async { in <lambda>()
67 val d2 = async(NonCancellable) { in <lambda>()
72 val d3 = async { in <lambda>()
[all …]
/external/python/jinja/src/jinja2/
Dasyncsupport.py1 """The code for async support. Importing this patches Jinja."""
15 async def concat_async(async_gen):
18 async def collect():
19 async for event in async_gen:
26 async def generate_async(self, *args, **kwargs):
29 async for event in self.root_render_func(self.new_context(vars)):
52 async def render_async(self, *args, **kwargs):
54 raise RuntimeError("The environment was not created with async mode enabled.")
77 async def async_call(self):
94 async def async_invoke(self, arguments, autoescape):
[all …]

12345678910>>...251