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

Solving the cycle issue with Subject

Now let's see how to use Subject to implement the directed cyclic graph of the previous example. Instead of referencing the a_out variable directly, Subject is used:

b_in_proxy = Subject()
b_out = component_b(b_in_proxy)
a_out = component_a(b_out)
a_out.subscribe(b_in_proxy)

The complete code of this example is available at: https://github.com/PacktPublishing/Hands-On-Reactive-Programming-with-Python in the cycle_subject.py script. 

主站蜘蛛池模板: 泰顺县| 固阳县| 于田县| 富民县| 天峨县| 宁阳县| 滨海县| 河东区| 会理县| 邳州市| 黄大仙区| 达孜县| 沂南县| 锦州市| 井冈山市| 呼和浩特市| 唐海县| 蕲春县| 西贡区| 桐城市| 沐川县| 邯郸市| 邮箱| 乐至县| 内黄县| 怀仁县| 蕲春县| 阳高县| 奉化市| 封丘县| 吉水县| 中卫市| 新乡市| 庄河市| 全椒县| 宁城县| 峨眉山市| 闽侯县| 龙海市| 沧源| 平武县|