跳到主要内容
本页尚未翻译

下面显示的是英文原文。

Server

The file broker reports the path of its stream file and the stdio broker its protocol name; neither reports a host.

A broker registered with with_broker_labeled is a server of the document, under its label. Both transports run inside the process, with nothing to connect to over a network, so a server has no host. The file broker's protocol is file, and its description is the path of the stream file, where a reader finds the log. The stdio broker's protocol is stdio, and it reports nothing else. Neither server carries a protocolVersion or bindings.

Example​

The stream file and the pipeline, registered under the labels file and pipe, come out as these two servers:

"servers": {
"file": { "protocol": "file", "description": "/var/lib/ruststream/orders.ss" },
"pipe": { "protocol": "stdio" }
}
/// The stream file the service records orders in.
fn file_broker() -> FileBroker {
FileBroker::new("/var/lib/ruststream/orders.ss")
}

/// The pipeline the service is a stage of.
fn stdio_broker() -> StdioBroker {
StdioBroker::new()
}