pub struct Server<T, Token>{
pub config: Configuration,
pub t0: Instant,
pub context: Context<T>,
pub interests: HashMap<String, HashSet<Token>>,
pub probe: ProbeHandle<T>,
pub scheduler: Rc<RefCell<Scheduler>>,
/* private fields */
}
Expand description
Server context maintaining globally registered arrangements and input handles.
Fields§
§config: Configuration
Server configuration.
t0: Instant
A timer started at the initation of the timely computation (copied from worker).
context: Context<T>
Implementation context.
interests: HashMap<String, HashSet<Token>>
Mapping from query names to interested client tokens.
probe: ProbeHandle<T>
Probe keeping track of overall dataflow progress.
scheduler: Rc<RefCell<Scheduler>>
Scheduler managing deferred operator activations.
Implementations§
Source§impl<T, Token> Server<T, Token>
impl<T, Token> Server<T, Token>
Sourcepub fn new(config: Configuration) -> Self
pub fn new(config: Configuration) -> Self
Creates a new server state from a configuration.
Sourcepub fn new_at(config: Configuration, t0: Instant) -> Self
pub fn new_at(config: Configuration, t0: Instant) -> Self
Creates a new server state from a configuration with an additionally specified beginning of the computation: an instant in relation to which all durations will be measured.
Sourcepub fn transact(
&mut self,
tx_data: Vec<TxData>,
owner: usize,
worker_index: usize,
) -> Result<(), Error>
pub fn transact( &mut self, tx_data: Vec<TxData>, owner: usize, worker_index: usize, ) -> Result<(), Error>
Handle a Transact request.
Sourcepub fn interest<S: Scope<Timestamp = T>>(
&mut self,
name: &str,
scope: &mut S,
) -> Result<Collection<S, Vec<Value>, isize>, Error>
pub fn interest<S: Scope<Timestamp = T>>( &mut self, name: &str, scope: &mut S, ) -> Result<Collection<S, Vec<Value>, isize>, Error>
Handles an Interest request.
Sourcepub fn register_source<S: Scope<Timestamp = T>>(
&mut self,
source: Box<dyn Sourceable<S>>,
scope: &mut S,
) -> Result<(), Error>
pub fn register_source<S: Scope<Timestamp = T>>( &mut self, source: Box<dyn Sourceable<S>>, scope: &mut S, ) -> Result<(), Error>
Handle a RegisterSource request.
Sourcepub fn advance_domain(
&mut self,
name: Option<String>,
next: T,
) -> Result<(), Error>
pub fn advance_domain( &mut self, name: Option<String>, next: T, ) -> Result<(), Error>
Handle an AdvanceDomain request.
Sourcepub fn uninterest(&mut self, client: Token, name: &str) -> Result<(), Error>
pub fn uninterest(&mut self, client: Token, name: &str) -> Result<(), Error>
Handles an Uninterest request, possibly cleaning up dataflows that are no longer interesting to any client.
Sourcepub fn disconnect_client(&mut self, client: Token) -> Result<(), Error>
pub fn disconnect_client(&mut self, client: Token) -> Result<(), Error>
Cleans up all bookkeeping state for the specified client.
Sourcepub fn is_any_outdated(&self) -> bool
pub fn is_any_outdated(&self) -> bool
Returns true iff the probe is behind any input handle. Mostly
used as a convenience method during testing. Using this within
step_while
is not safe in general and might lead to stalls.
Sourcepub fn test_single<S: Scope<Timestamp = T>>(
&mut self,
scope: &mut S,
rule: Rule,
) -> Collection<S, Vec<Value>, isize>
pub fn test_single<S: Scope<Timestamp = T>>( &mut self, scope: &mut S, rule: Rule, ) -> Collection<S, Vec<Value>, isize>
Helper for registering, publishing, and indicating interest in a single, named query. Used for testing.