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

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.

主站蜘蛛池模板: 泾川县| 措美县| 隆尧县| 南安市| 玉门市| 大渡口区| 淮滨县| 郸城县| 武夷山市| 南召县| 鲁甸县| 阿鲁科尔沁旗| 普兰县| 施甸县| 绥江县| 天等县| 新和县| 乌审旗| 上林县| 左云县| 彭州市| 介休市| 晋中市| 九龙县| 株洲市| 商洛市| 手游| 勐海县| 滦南县| 台山市| 华安县| 宜州市| 奉节县| 黑河市| 隆化县| 韩城市| 大足县| 河源市| 浏阳市| 宝兴县| 荣成市|