Struct ns_router::Config [] [src]

pub struct Config { /* fields omitted */ }

Configuration of the router

It has a builder interface. You can create a router from Arc<Config> (made by Config::done) or a stream of configs.

Methods

impl Config
[src]

[src]

Create a new, empty config

[src]

Sets delay after which router will restart any subscription stream

This works both when stream yields end-of-stream and when stream has returned error. Default value is 100 milliseconds.

[src]

Sets delay used by subscribe_many family of functions

The timeout is set when a new set of names arrives via stream or when configuration is updated. While the timer is active we don't send name updates to the application unless all (new) names are resolved.

Good value is bigger than 90 or 99 percentile of name request latency, but small enough that delay of this long doesn't introduce any hiccups on the application.

For example, if there are names [A, B, C] if C is resolved first we wait for the 100 millisecond (by default) timer to finish to let A and B also be resolved. If they aren't within the period only names in C are returned.

Note if names are reloved later, they are added to the address set and update is delivered to the client. I.e. it's only important something depends on the first address value.

The case where it's important is following: Client establishes few persistent connections by picking random IP Addresses from the set. Once new addresses arrive connections are still hold until one of them is broken. In this case, the first address (or the one that can be resolved faster for any reason) would have more connections received in most cases which might be a problem.

[src]

Add a host that will be resolved to list of addreses

Hosts added by this host method overrides any other resolvers.

[src]

Add a service that will be resolved to an Address object

Service names added by this host method overrides any other resolvers.

[src]

Add a resolver for suffix

Note: you must supply a full resolver here, use null_resolver/null_host_resolver and interval_subscribe or frozen_subscriber and other combinators to fullfill needed type.

[src]

Removes already configured suffix

[src]

Adds a host resolver used whenever no suffix matches

[src]

A convenience method that returns Arc'd config

Trait Implementations

impl Clone for Config
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Config
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !Send for Config

impl !Sync for Config