1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Shared helpers for reactor-mode integration tests.
//!
//! Each `tests/integration_reactor_s3_*.rs` binary imports both
//! `common/` (for `TestFile`, env config, interceptors) and this
//! module for the reactor-specific bits:
//!
//! ```ignore
//! #[allow(dead_code)]
//! mod common;
//! #[allow(dead_code)]
//! mod common_reactor;
//! use common::*;
//! use common_reactor::*;
//! ```
//!
//! The whole module is gated on `feature = "reactor"` because none
//! of the reactor APIs (`HyperFileHandler`, `HyperFileTokio`,
//! `Reactor`) exist without it.
use Hyper;
use FileContext;
use Reactor;
/// Type alias for the reactor used by hyperfile tests. The reactor
/// owns an OS thread running a current-thread tokio runtime that
/// hosts the `Hyper` instance and its handler loop.
pub type HyperReactor = ;
/// Create a fresh reactor using `new_current` (current-thread
/// runtime).
///
/// When the returned reactor is dropped (along with every
/// `HyperFileHandler` clone derived from it), the backing OS
/// thread winds down once its handler loops exit and all tasks
/// complete. Tests do not need to join the thread explicitly; the
/// process will reap it.