File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 164
164
//! possibly pinned to a particular scheduler thread:
165
165
//!
166
166
//! ```rust
167
+ //! extern crate green;
168
+ //! extern crate rustuv;
169
+ //!
170
+ //! # fn main() {
167
171
//! use std::task::TaskBuilder;
168
172
//! use green::{SchedPool, PoolConfig, GreenTaskBuilder};
169
173
//!
170
- //! let config = PoolConfig::new();
174
+ //! let mut config = PoolConfig::new();
175
+ //!
176
+ //! // Optional: Set the event loop to be rustuv's to allow I/O to work
177
+ //! config.event_loop_factory = rustuv::event_loop;
178
+ //!
171
179
//! let mut pool = SchedPool::new(config);
172
180
//!
173
181
//! // Spawn tasks into the pool of schedulers
195
203
//! // Required to shut down this scheduler pool.
196
204
//! // The task will fail if `shutdown` is not called.
197
205
//! pool.shutdown();
206
+ //! # }
198
207
//! ```
199
208
200
209
#![ crate_name = "green" ]
You can’t perform that action at this time.
0 commit comments