Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
David Gross edited this pageJan 19, 2015 ·22 revisions

ASubject is a sort of bridge or proxy that acts both as anSubscriber and as anObservable. Because it is a Subscriber, it can subscribe to one or more Observables, and because it is an Observable, it can pass through the items it observes by reemitting them, and it can also emit new items.

For more information about the varieties of Subject and how to use them, seethe ReactiveXSubject documentation.

Serializing

When you use a Subject as a Subscriber, take care not to call itsonNext( ) method (or its otheron methods) from multiple threads, as this could lead to non-serialized calls, which violates the Observable contract and creates an ambiguity in the resulting Subject.

To protect a Subject from this danger, you can convert it into aSerializedSubject with code like the following:

mySafeSubject =newSerializedSubject(myUnsafeSubject );

Copyright (c) 2016-present, RxJava Contributors.
Twitter @RxJava |Gitter @RxJava

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp