Home
last modified time | relevance | path

Searched refs:Duration (Results 1 – 25 of 39) sorted by relevance

12

/tonic/tonic-types/src/richer_error/std_messages/
H A Dretry_info.rs20 pub retry_delay: Option<time::Duration>,
29 pub const MAX_RETRY_DELAY: time::Duration = time::Duration::new(315_576_000_000, 999_999_999);
34 pub fn new(retry_delay: Option<time::Duration>) -> Self { in new()
87 let duration = time::Duration::try_from(duration).unwrap_or(time::Duration::ZERO); in from()
102 let duration = match prost_types::Duration::try_from(duration) { in from()
104 Err(_) => prost_types::Duration { in from()
120 use core::time::Duration;
127 let retry_info = RetryInfo::new(Some(Duration::from_secs(u64::MAX))); in gen_retry_info()
/tonic/tests/integration_tests/tests/
H A Dtimeout.rs2 use std::{net::SocketAddr, time::Duration};
8 let addr = run_service_in_background(Duration::from_secs(1), Duration::from_secs(100)).await; in cancelation_on_timeout()
28 let addr = run_service_in_background(Duration::from_secs(1), Duration::from_millis(100)).await; in picks_server_timeout_if_thats_sorter()
47 let addr = run_service_in_background(Duration::from_secs(1), Duration::from_secs(100)).await; in picks_client_timeout_if_thats_sorter()
64 async fn run_service_in_background(latency: Duration, server_timeout: Duration) -> SocketAddr { in run_service_in_background() argument
66 latency: Duration, in run_service_in_background()
H A Dhttp2_keep_alive.rs1 use std::time::Duration;
29 .http2_keepalive_interval(Some(Duration::from_secs(10))) in http2_keepalive_does_not_cause_panics()
36 tokio::time::sleep(Duration::from_millis(100)).await; in http2_keepalive_does_not_cause_panics()
59 .http2_keepalive_interval(Some(Duration::from_secs(5))) in http2_keepalive_does_not_cause_panics_on_client_side()
66 tokio::time::sleep(Duration::from_millis(100)).await; in http2_keepalive_does_not_cause_panics_on_client_side()
70 .http2_keep_alive_interval(Duration::from_secs(5)) in http2_keepalive_does_not_cause_panics_on_client_side()
H A Dconnection.rs3 use std::time::Duration;
55 tokio::time::sleep(Duration::from_millis(100)).await; in connect_returns_err_via_call_after_connected()
62 tokio::time::sleep(Duration::from_millis(100)).await; in connect_returns_err_via_call_after_connected()
105 tokio::time::sleep(Duration::from_millis(100)).await; in connect_lazy_reconnects_after_first_failure()
109 tokio::time::sleep(Duration::from_millis(100)).await; in connect_lazy_reconnects_after_first_failure()
H A Dhttp2_max_header_list_size.rs1 use std::time::Duration;
37 let (nodelay, keepalive) = (Some(true), Some(Duration::from_secs(1))); in test_http_max_header_list_size_and_long_errors()
49 tokio::time::sleep(Duration::from_millis(100)).await; in test_http_max_header_list_size_and_long_errors()
H A Duser_agent.rs2 use std::time::Duration;
39 tokio::time::sleep(Duration::from_millis(100)).await; in writes_user_agent_header()
H A Dinterceptor.rs2 use std::time::Duration;
54 tokio::time::sleep(Duration::from_millis(100)).await; in interceptor_retrieves_grpc_method()
H A Dclient_layer.rs3 use std::time::Duration;
58 tokio::time::sleep(Duration::from_millis(100)).await; in connect_supports_standard_tower_layers()
H A Dstatus.rs10 use std::time::Duration;
49 tokio::time::sleep(Duration::from_millis(100)).await; in status_with_details()
107 tokio::time::sleep(Duration::from_millis(100)).await; in status_with_metadata()
178 tokio::time::sleep(Duration::from_millis(100)).await; in status_from_server_stream()
248 tokio::time::sleep(Duration::from_millis(100)).await; in message_and_then_status_from_server_stream()
H A Dextensions.rs7 time::Duration,
54 tokio::time::sleep(Duration::from_millis(100)).await; in setting_extension_from_interceptor()
103 tokio::time::sleep(Duration::from_millis(100)).await; in setting_extension_from_tower()
H A Dorigin.rs6 use std::time::Duration;
47 tokio::time::sleep(Duration::from_millis(100)).await; in writes_origin_header()
H A Droutes_builder.rs1 use std::time::Duration;
72 tokio::time::sleep(Duration::from_millis(100)).await; in multiple_service_using_routes_builder()
/tonic/tonic/src/transport/service/
H A Dgrpc_timeout.rs8 time::Duration,
16 server_timeout: Option<Duration>,
105 ) -> Result<Option<Duration>, &HeaderValue> { in try_parse_grpc_timeout() argument
135 "S" => Duration::from_secs(timeout_value), in try_parse_grpc_timeout()
137 "m" => Duration::from_millis(timeout_value), in try_parse_grpc_timeout()
139 "u" => Duration::from_micros(timeout_value), in try_parse_grpc_timeout()
141 "n" => Duration::from_nanos(timeout_value), in try_parse_grpc_timeout()
174 assert_eq!(Duration::from_secs(60), parsed_duration); in test_minutes()
180 assert_eq!(Duration::from_secs(42), parsed_duration); in test_seconds()
192 assert_eq!(Duration::from_micros(2), parsed_duration); in test_microseconds()
[all …]
/tonic/examples/src/dynamic_load_balance/
H A Dclient.rs26 tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; in main()
31 tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; in main()
36 tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; in main()
42 tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; in main()
48 tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; in main()
55 tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; in main()
64 tokio::time::sleep(tokio::time::Duration::from_millis(500)).await; in main()
70 if let Ok(resp) = timeout(tokio::time::Duration::from_secs(10), rx).await { in main()
/tonic/tonic/src/transport/channel/
H A Dendpoint.rs23 pub(crate) timeout: Option<Duration>,
25 pub(crate) rate_limit: Option<(u64, Duration)>,
31 pub(crate) tcp_keepalive: Option<Duration>,
33 pub(crate) http2_keep_alive_interval: Option<Duration>,
34 pub(crate) http2_keep_alive_timeout: Option<Duration>,
37 pub(crate) connect_timeout: Option<Duration>,
146 pub fn timeout(self, dur: Duration) -> Self { in timeout()
163 pub fn connect_timeout(self, dur: Duration) -> Self { in connect_timeout()
277 pub fn keep_alive_timeout(self, duration: Duration) -> Self { in keep_alive_timeout()
430 pub fn get_connect_timeout(&self) -> Option<Duration> { in get_connect_timeout() argument
[all …]
/tonic/examples/src/streaming/
H A Dclient.rs5 use std::time::Duration;
50 async fn bidirectional_streaming_echo_throttle(client: &mut EchoClient<Channel>, dur: Duration) { in bidirectional_streaming_echo_throttle() argument
72 tokio::time::sleep(Duration::from_secs(1)).await; //do not mess server println functions in main()
82 bidirectional_streaming_echo_throttle(&mut client, Duration::from_secs(2)).await; in main()
/tonic/examples/src/cancellation/
H A Dclient.rs4 use tokio::time::{timeout, Duration};
19 let response = match timeout(Duration::from_secs(1), client.say_hello(request)).await { in main()
H A Dserver.rs11 use tokio::time::Duration;
31 sleep(Duration::from_secs(10)).await; in say_hello()
/tonic/tonic/src/
H A Drequest.rs11 use std::time::Duration;
293 pub fn set_timeout(&mut self, deadline: Duration) { in set_timeout() argument
397 fn duration_to_grpc_timeout(duration: Duration) -> String { in duration_to_grpc_timeout()
399 duration: Duration, in duration_to_grpc_timeout() argument
401 convert: impl FnOnce(Duration) -> T, in duration_to_grpc_timeout()
467 let timeout = Duration::from_millis(500); in duration_to_grpc_timeout_less_than_second()
474 let timeout = Duration::from_secs(30); in duration_to_grpc_timeout_more_than_second()
481 let one_hour = Duration::from_secs(60 * 60); in duration_to_grpc_timeout_a_very_long_time()
/tonic/examples/src/health/
H A Dserver.rs5 use std::time::Duration;
36 tokio::time::sleep(Duration::from_secs(1)).await; in twiddle_service_status()
/tonic/tonic/src/service/
H A Dlayered.rs84 use std::time::Duration; in named_service_is_propagated_to_layered()
87 let layered = TimeoutLayer::new(Duration::from_secs(5)).named_layer(TestService::default()); in named_service_is_propagated_to_layered()
/tonic/tonic/src/transport/server/
H A Dincoming.rs5 time::Duration,
69 pub fn with_keepalive(self, keepalive: Option<Duration>) -> Self { in with_keepalive()
H A Dmod.rs62 time::Duration,
92 timeout: Option<Duration>,
98 tcp_keepalive: Option<Duration>,
100 http2_keepalive_interval: Option<Duration>,
101 http2_keepalive_timeout: Option<Duration>,
108 max_connection_age: Option<Duration>,
196 pub fn timeout(self, timeout: Duration) -> Self { in timeout()
328 pub fn tcp_keepalive(self, tcp_keepalive: Option<Duration>) -> Self { in tcp_keepalive()
772 max_connection_age: Option<Duration>, in serve_connection() argument
818 async fn sleep_or_pending(wait_for: Option<Duration>) { in sleep_or_pending() argument
[all …]
/tonic/examples/src/routeguide/
H A Dclient.rs2 use std::time::Duration;
65 let mut interval = time::interval(Duration::from_secs(1)); in run_route_chat()
/tonic/interop/src/bin/
H A Dclient.rs2 use std::{str::FromStr, time::Duration};
36 .timeout(Duration::from_secs(5)) in main()

12