官术网_书友最值得收藏!

Subscription rules

The following interface describes the Subscription notation:

public interface Subscription {
public void request(long n);
public void cancel();
}

The rule number 3.2 says, Subscription must allow the Subscriber to call Subscription.request synchronously from within onNext or onSubscribe. It talks about preventing both Publisher and Subscriber by restricting posting of the message only when  Publisher gets the signal for a further request from Subscriber. This happens in a synchronous manner to avoid a stack overflow.

In a similar context, another rule, number 3.3, states, Subscription.request() must place an upper bound on possible synchronous recursion between Publisher and Subscriber. It complements rule 3.2 in a sense by deciding an upper limit in the recursive interaction between Publisher and Subscriber in the form of the onNext() and request() call. Setting the upper limit will avoid blowing out when calling a thread stack. The rules starting from number 3.5 to 3.15 describe the behavior of cancelling and completing the request.

主站蜘蛛池模板: 庆元县| 瑞金市| 鲁甸县| 庄河市| 河北省| 南投市| 金沙县| 高安市| 古浪县| 吉林市| 毕节市| 丰原市| 博爱县| 渭源县| 滨州市| 肥乡县| 浮梁县| 林周县| 安国市| 吉安市| 连平县| 昆明市| 南投市| 库尔勒市| 平遥县| 同江市| 邹城市| 昌乐县| 霞浦县| 平度市| 平阳县| 枣庄市| 泊头市| 中西区| 陇川县| 渑池县| 龙泉市| 灵台县| 泰安市| 九台市| 玛纳斯县|