Update book
This commit is contained in:
parent
ba03ccf3ea
commit
646c6155cd
|
@ -1,6 +1,6 @@
|
||||||
# Subscription
|
# Subscription
|
||||||
|
|
||||||
The definition of the subscription root object is slightly different from other root objects. Its resolver function always returns a [Stream](https://docs.rs/futures-core/~0.3/futures_core/stream/trait.Stream.html), and the field parameters are usually used as data filtering conditions.
|
The definition of the subscription root object is slightly different from other root objects. Its resolver function always returns a [Stream](https://docs.rs/futures-core/~0.3/futures_core/stream/trait.Stream.html) or `FieldResult<Stream>`, and the field parameters are usually used as data filtering conditions.
|
||||||
|
|
||||||
The following example subscribes to an integer stream, which generates one integer per second. The parameter `step` specifies the integer step size with a default of 1.
|
The following example subscribes to an integer stream, which generates one integer per second. The parameter `step` specifies the integer step size with a default of 1.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# 订阅
|
# 订阅
|
||||||
|
|
||||||
订阅根对象和其它根对象定义稍有不同,它的Resolver函数总是返回一个`Stream`,而字段参数通常作为数据的筛选条件。
|
订阅根对象和其它根对象定义稍有不同,它的Resolver函数总是返回一个 [Stream](https://docs.rs/futures-core/~0.3/futures_core/stream/trait.Stream.html) 或者`FieldResult<Stream>`,而字段参数通常作为数据的筛选条件。
|
||||||
|
|
||||||
下面的例子订阅一个整数流,它每秒产生一个整数,参数`step`指定了整数的步长,默认为1。
|
下面的例子订阅一个整数流,它每秒产生一个整数,参数`step`指定了整数的步长,默认为1。
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user