Struct async_mesos::client::Client [] [src]

pub struct Client {
    pub uri: Uri,
    pub framework_id: String,
    pub stream_id: String,
}

Mesos client connection.

This holds all connection information for a Mesos framework. The framework id should be persisted to recover after a failover.

Example

use async_mesos::mesos;
use async_mesos::client::{Client, Events};
use hyper::Uri;
use tokio_core::reactor::Core;

// Create a Tokio core handle.
let mut core = Core::new().expect("Could not create core.");
let handle = core.handle();

// Create the Mesos framework info to register a new framework.
let mut framework_info = mesos::FrameworkInfo::new();
framework_info.set_user(String::from("donnie"));
framework_info.set_name(String::from("Example FOO Framework"));

// Connect to Mesos scheduler API.
let uri = "http://localhost:5050/api/v1/scheduler"
    .parse::<Uri>()
    .expect("Could not parse Uri.");
let future_client = Client::connect(&handle, uri, framework_info);
let (client, events) = core.run(future_client).unwrap();

Fields

The adress of the Mesos scheduler, e.g. http://localhost:5050/api/v1/scheduler.

Identification of the registered Mesos framework.

Identification of the attached event stream.

Methods

impl Client
[src]

[src]

Connect to Mesos and subscribe to V1 scheduler events.

Argument

  • handle - A handle to a Tokio loop.
  • uri - The uri to the Mesos V1 scheduler API, e.g http://localhost:5050/api/v1/scheduler
  • framework_info - Information of the framework that registers with Mesos.

[src]

Construct teardown call.

The teardown call deregisters framework from Mesos.

[src]

Construct Accept call.

Arguments

  • offer_ids - Vector over ids of offers that are accepted.
  • operations - The operations to perform on offers.

[src]

Construct Acknowledge Call

Arguments

  • update_status - The task status sent along with the update event.

[src]

Make a call to Mesos.

Argument

  • handle - A handle to a Tokio loop.
  • call - The content of the call, e.g. Accept for an offer.

Trait Implementations

impl Clone for Client
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Client
[src]

[src]

Formats the value using the given formatter.