Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion communication/examples/comm_hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Bytesable for Message {
fn main() {

// extract the configuration from user-supplied arguments, initialize the computation.
let config = timely_communication::Config::from_args(std::env::args()).unwrap();
let (config, _free) = timely_communication::Config::from_args(std::env::args()).unwrap();
let guards = timely_communication::initialize(config, |mut allocator| {

println!("worker {} of {} started", allocator.index(), allocator.peers());
Expand Down
9 changes: 5 additions & 4 deletions communication/src/initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,13 @@ impl Config {
///
/// This method is only available if the `getopts` feature is enabled, which
/// it is by default.
/// The `Ok` variant returns the free command-line arguments as well as the config.
#[cfg(feature = "getopts")]
pub fn from_args<I: Iterator<Item=String>>(args: I) -> Result<Config, String> {
pub fn from_args<I: Iterator<Item=String>>(args: I) -> Result<(Config, Vec<String>), String> {
let mut opts = getopts::Options::new();
Config::install_options(&mut opts);
let matches = opts.parse(args).map_err(|e| e.to_string())?;
Config::from_matches(&matches)
Config::from_matches(&matches).map(|c| (c, matches.free))
}

/// Attempts to assemble the described communication infrastructure.
Expand Down Expand Up @@ -224,7 +225,7 @@ impl Config {
/// }
///
/// // extract the configuration from user-supplied arguments, initialize the computation.
/// let config = timely_communication::Config::from_args(std::env::args()).unwrap();
/// let (config, _free) = timely_communication::Config::from_args(std::env::args()).unwrap();
/// let guards = timely_communication::initialize(config, |mut allocator| {
///
/// println!("worker {} of {} started", allocator.index(), allocator.peers());
Expand Down Expand Up @@ -317,7 +318,7 @@ pub fn initialize<T:Send+'static, F: Fn(Generic)->T+Send+Sync+'static>(
/// }
///
/// // extract the configuration from user-supplied arguments, initialize the computation.
/// let config = timely_communication::Config::from_args(std::env::args()).unwrap();
/// let (config, _free) = timely_communication::Config::from_args(std::env::args()).unwrap();
/// let guards = timely_communication::initialize(config, |mut allocator| {
///
/// println!("worker {} of {} started", allocator.index(), allocator.peers());
Expand Down
2 changes: 1 addition & 1 deletion communication/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
//! }
//!
//! // extract the configuration from user-supplied arguments, initialize the computation.
//! let config = timely_communication::Config::from_args(std::env::args()).unwrap();
//! let (config, _free) = timely_communication::Config::from_args(std::env::args()).unwrap();
//! let guards = timely_communication::initialize(config, |mut allocator| {
//!
//! println!("worker {} of {} started", allocator.index(), allocator.peers());
Expand Down
2 changes: 1 addition & 1 deletion mdbook/src/chapter_5/chapter_5_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Bytesable for Message {
fn main() {

// extract the configuration from user-supplied arguments, initialize the computation.
let config = timely_communication::Config::from_args(std::env::args()).unwrap();
let (config, _free) = timely_communication::Config::from_args(std::env::args()).unwrap();
let guards = timely_communication::initialize(config, |mut allocator| {

println!("worker {} of {} started", allocator.index(), allocator.peers());
Expand Down
Loading