Skip to content
Merged
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
24 changes: 24 additions & 0 deletions timely/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,30 @@ impl<A: Allocate> Worker<A> {
self.dataflow_core("Dataflow", logging, Box::new(()), |_, child| func(child))
}

/// Construct a new dataflow with a (purely cosmetic) name.
///
/// # Examples
/// ```
/// timely::execute_from_args(::std::env::args(), |worker| {
///
/// // We must supply the timestamp type here, although
/// // it would generally be determined by type inference.
/// worker.dataflow_named::<usize,_,_>("Some Dataflow", |scope| {
///
/// // uses of `scope` to build dataflow
///
/// });
/// });
/// ```
pub fn dataflow_named<T, R, F>(&mut self, name: &str, func: F) -> R
where
T: Refines<()>,
F: FnOnce(&mut Child<Self, T>)->R,
{
let logging = self.logging.borrow_mut().get("timely");
self.dataflow_core(name, logging, Box::new(()), |_, child| func(child))
}

/// Construct a new dataflow with specific configurations.
///
/// This method constructs a new dataflow, using a name, logger, and additional
Expand Down