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

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.

主站蜘蛛池模板: 隆安县| 曲靖市| 桃江县| 菏泽市| 石景山区| 武隆县| 玉树县| 林芝县| 神农架林区| 炉霍县| 科技| 南召县| 库尔勒市| 三原县| 洪泽县| 威远县| 治县。| 习水县| 邮箱| 鲜城| 文水县| 建昌县| 宝坻区| 通海县| 平南县| 万载县| 东辽县| 怀来县| 肥乡县| 南康市| 太仓市| 收藏| 兰州市| 遂宁市| 安化县| 阿荣旗| 澄城县| 郸城县| 积石山| 伽师县| 大余县|