Trait trawler::LobstersClient [] [src]

pub trait LobstersClient {
    type Factory;
    fn spawn(_: &mut Self::Factory, _: &Handle) -> Self;
fn handle(
        _: Rc<Self>,
        _: Option<UserId>,
        _: LobstersRequest
    ) -> Box<Future<Item = Duration, Error = ()>>; }

Implementors of this trait handle [LobstersRequest] that correspond to "real" lobste.rs website requests queued up by the workload generator.

Note that the workload generator does not check that the implementor correctly perform the queries corresponding to each request; this must be verified with manual inspection of the Rails application or its query logs.

In order to allow generating more load, the load generator spins up multiple "issuers" that each have their own LobstersClient. The associated Factory type tells the generator how to spawn more clients.

Associated Types

The type used to spawn more clients of this type.

Required Methods

Spawn a new client for an issuer running the given tokio reactor.

Handle the given lobste.rs request, made on behalf of the given user, returning a future that resolves when the request has been satisfied.

Implementors