[][src]Struct noria::ControllerHandle

pub struct ControllerHandle<A> where
    A: 'static + Authority, 
{ /* fields omitted */ }

A handle to a Noria controller.

This handle is the primary mechanism for interacting with a running Noria instance, and lets you add and remove queries, retrieve handles for inserting or querying the underlying data, and to perform meta-operations such as fetching the dataflow's GraphViz visualization.

To establish a new connection to Noria, use ControllerHandle::new, and pass in the appropriate Authority. In the likely case that you are using Zookeeper, use ControllerHandle::from_zk.

Note that whatever Tokio Runtime you use to execute the Future that resolves into the ControllerHandle will also be the one that executes all your reads and writes through View and Table. Make sure that that Runtime stays alive, and continues to be driven, otherwise none of your operations will ever complete! Furthermore, you must use the Runtime to execute any futures returned from ControllerHandle (that is, you cannot just call .wait() on them).

Implementations

impl ControllerHandle<ZookeeperAuthority>[src]

pub async fn from_zk<'_>(zookeeper_address: &'_ str) -> Result<Self, Error>[src]

Fetch information about the current Soup controller from Zookeeper running at the given address, and create a ControllerHandle from that.

impl<A: Authority + 'static> ControllerHandle<A>[src]

pub fn poll_ready(&mut self, cx: &mut Context) -> Poll<Result<(), Error>>[src]

Check that the ControllerHandle can accept another request.

Note that this method must return Poll::Ready before any other methods that return a Future on ControllerHandle can be called.

pub async fn ready<'_>(&'_ mut self) -> Result<(), Error>[src]

A future that resolves when the controller can accept more messages.

When this future resolves, you it is safe to call any methods that require poll_ready to have returned Poll::Ready.

pub async fn new(authority: A) -> Result<Self, Error> where
    A: Send + 'static, 
[src]

Create a ControllerHandle that bootstraps a connection to Noria via the configuration stored in the given authority.

You probably want to use ControllerHandle::from_zk instead.

pub fn inputs(
    &mut self
) -> impl Future<Output = Result<BTreeMap<String, NodeIndex>, Error>>
[src]

Enumerate all known base tables.

These have all been created in response to a CREATE TABLE statement in a recipe.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn outputs(
    &mut self
) -> impl Future<Output = Result<BTreeMap<String, NodeIndex>, Error>>
[src]

Enumerate all known external views.

These have all been created in response to a CREATE EXT VIEW statement in a recipe.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn view(&mut self, name: &str) -> impl Future<Output = Result<View, Error>>[src]

Obtain a View that allows you to query the given external view.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn table(
    &mut self,
    name: &str
) -> impl Future<Output = Result<Table, Error>>
[src]

Obtain a Table that allows you to perform writes, deletes, and other operations on the given base table.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn statistics(&mut self) -> impl Future<Output = Result<GraphStats, Error>>[src]

Get statistics about the time spent processing different parts of the graph.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn flush_partial(&mut self) -> impl Future<Output = Result<(), Error>>[src]

Flush all partial state, evicting all rows present.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn extend_recipe(
    &mut self,
    recipe_addition: &str
) -> impl Future<Output = Result<ActivationResult, Error>>
[src]

Extend the existing recipe with the given set of queries.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn install_recipe(
    &mut self,
    new_recipe: &str
) -> impl Future<Output = Result<ActivationResult, Error>>
[src]

Replace the existing recipe with this one.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn graphviz(&mut self) -> impl Future<Output = Result<String, Error>>[src]

Fetch a graphviz description of the dataflow graph.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn simple_graphviz(&mut self) -> impl Future<Output = Result<String, Error>>[src]

Fetch a simplified graphviz description of the dataflow graph.

Self::poll_ready must have returned Async::Ready before you call this method.

pub fn remove_node(
    &mut self,
    view: NodeIndex
) -> impl Future<Output = Result<(), Error>>
[src]

Remove the given external view from the graph.

Self::poll_ready must have returned Async::Ready before you call this method.

Trait Implementations

impl<A> Clone for ControllerHandle<A> where
    A: 'static + Authority, 
[src]

Auto Trait Implementations

impl<A> !RefUnwindSafe for ControllerHandle<A>

impl<A> Send for ControllerHandle<A>

impl<A> Sync for ControllerHandle<A>

impl<A> Unpin for ControllerHandle<A>

impl<A> !UnwindSafe for ControllerHandle<A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]