├── settings.gradle
├── src
├── main
│ ├── resources
│ │ └── META-INF
│ │ │ └── proguard
│ │ │ └── rxjava3.pro
│ └── java
│ │ └── io
│ │ └── reactivex
│ │ └── rxjava3
│ │ ├── internal
│ │ ├── fuseable
│ │ │ ├── package-info.java
│ │ │ ├── HasUpstreamCompletableSource.java
│ │ │ ├── HasUpstreamMaybeSource.java
│ │ │ └── HasUpstreamSingleSource.java
│ │ ├── schedulers
│ │ │ └── NonBlockingThread.java
│ │ ├── util
│ │ │ ├── SuppressAnimalSniffer.java
│ │ │ ├── ErrorMode.java
│ │ │ ├── ConnectConsumer.java
│ │ │ ├── HashMapSupplier.java
│ │ │ ├── SorterFunction.java
│ │ │ └── ListAddBiConsumer.java
│ │ ├── operators
│ │ │ ├── single
│ │ │ │ ├── SingleFromUnsafeSource.java
│ │ │ │ ├── SingleNever.java
│ │ │ │ └── SingleJust.java
│ │ │ ├── observable
│ │ │ │ ├── ObservableFromUnsafeSource.java
│ │ │ │ ├── ObservableNever.java
│ │ │ │ └── ObservableSerialized.java
│ │ │ ├── completable
│ │ │ │ ├── CompletableFromUnsafeSource.java
│ │ │ │ ├── CompletableEmpty.java
│ │ │ │ ├── CompletableError.java
│ │ │ │ └── CompletableNever.java
│ │ │ ├── flowable
│ │ │ │ ├── FlowableFromPublisher.java
│ │ │ │ ├── FlowableSerialized.java
│ │ │ │ └── FlowableNever.java
│ │ │ └── maybe
│ │ │ │ ├── MaybeNever.java
│ │ │ │ └── MaybeUnsafeCreate.java
│ │ ├── observers
│ │ │ ├── InnerQueuedObserverSupport.java
│ │ │ └── BlockingLastObserver.java
│ │ └── subscribers
│ │ │ ├── InnerQueuedSubscriberSupport.java
│ │ │ └── BlockingLastSubscriber.java
│ │ ├── operators
│ │ ├── package-info.java
│ │ └── SimplePlainQueue.java
│ │ ├── functions
│ │ ├── package-info.java
│ │ ├── Cancellable.java
│ │ ├── Action.java
│ │ ├── BooleanSupplier.java
│ │ ├── LongConsumer.java
│ │ ├── Consumer.java
│ │ ├── Predicate.java
│ │ └── IntFunction.java
│ │ ├── plugins
│ │ └── package-info.java
│ │ ├── parallel
│ │ └── package-info.java
│ │ ├── annotations
│ │ ├── Beta.java
│ │ ├── Experimental.java
│ │ ├── CheckReturnValue.java
│ │ ├── package-info.java
│ │ ├── NonNull.java
│ │ ├── Nullable.java
│ │ └── BackpressureSupport.java
│ │ ├── flowables
│ │ └── package-info.java
│ │ ├── observables
│ │ └── package-info.java
│ │ ├── disposables
│ │ ├── package-info.java
│ │ └── SubscriptionDisposable.java
│ │ ├── schedulers
│ │ └── package-info.java
│ │ ├── core
│ │ └── BackpressureOverflowStrategy.java
│ │ ├── subscribers
│ │ └── package-info.java
│ │ └── exceptions
│ │ ├── ProtocolViolationException.java
│ │ └── package-info.java
└── test
│ └── java
│ └── io
│ └── reactivex
│ └── rxjava3
│ ├── testsupport
│ └── SuppressUndeliverable.java
│ ├── internal
│ ├── schedulers
│ │ └── ExecutorSchedulerInternalTest.java
│ ├── operators
│ │ ├── maybe
│ │ │ ├── MaybeMergeWithTest.java
│ │ │ ├── MaybeSubscribeOnTest.java
│ │ │ ├── MaybeIsEmptySingleTest.java
│ │ │ ├── MaybeEmptyTest.java
│ │ │ ├── MaybeJustTest.java
│ │ │ └── MaybeConcatArrayEagerDelayErrorTest.java
│ │ ├── mixed
│ │ │ └── ScalarXMapZHelperTest.java
│ │ ├── flowable
│ │ │ ├── FlowableInternalHelperTest.java
│ │ │ └── FlowableAutoConnectTest.java
│ │ ├── observable
│ │ │ └── ObservableAutoConnectTest.java
│ │ └── single
│ │ │ ├── SingleConcatArrayDelayErrorTest.java
│ │ │ └── SingleConcatArrayEagerDelayErrorTest.java
│ ├── observers
│ │ ├── InnerQueuedObserverTest.java
│ │ ├── EmptyCompletableObserverTest.java
│ │ └── BlockingObserverTest.java
│ └── jdk8
│ │ ├── MaybeFromOptionalTest.java
│ │ ├── FlowableFromOptionalTest.java
│ │ └── ObservableFromOptionalTest.java
│ ├── tck
│ ├── RepeatTckTest.java
│ ├── HideTckTest.java
│ ├── FromIterableTckTest.java
│ ├── RangeTckTest.java
│ ├── ShareTckTest.java
│ ├── RetryTckTest.java
│ ├── SortedTckTest.java
│ ├── CacheTckTest.java
│ ├── SkipTckTest.java
│ ├── TakeTckTest.java
│ ├── LimitTckTest.java
│ ├── PublishTckTest.java
│ ├── ReplayTckTest.java
│ ├── SkipLastTckTest.java
│ ├── SkipUntilTckTest.java
│ ├── TakeLastTckTest.java
│ ├── TakeUntilTckTest.java
│ ├── DefaultIfEmptyTckTest.java
│ ├── RebatchRequestsTckTest.java
│ ├── OnErrorReturnItemTckTest.java
│ ├── OnBackpressureBufferTckTest.java
│ ├── MergeWithMaybeEmptyTckTest.java
│ ├── SwitchIfEmptyTckTest.java
│ ├── EmptyTckTest.java
│ ├── MergeWithCompletableTckTest.java
│ ├── OnErrorResumeWithTckTest.java
│ ├── DistinctUntilChangedTckTest.java
│ ├── CompletableAndThenPublisherTckTest.java
│ ├── TimeoutTckTest.java
│ ├── ConcatWithCompletableTckTest.java
│ ├── ConcatWithMaybeEmptyTckTest.java
│ ├── JustTckTest.java
│ ├── TimestampTckTest.java
│ ├── BufferExactSizeTckTest.java
│ ├── ConcatWithMaybeTckTest.java
│ ├── ConcatWithSingleTckTest.java
│ ├── MapTckTest.java
│ ├── SwitchOnNextTckTest.java
│ ├── TimeIntervalTckTest.java
│ ├── SubscribeOnTckTest.java
│ ├── DistinctTckTest.java
│ ├── DoFinallyTckTest.java
│ ├── DoOnNextTckTest.java
│ ├── SkipWhileTckTest.java
│ ├── TakeWhileTckTest.java
│ ├── DoAfterNextTckTest.java
│ ├── FromArrayTckTest.java
│ ├── IntervalRangeTckTest.java
│ ├── LastTckTest.java
│ ├── AmbArrayTckTest.java
│ ├── FirstTckTest.java
│ ├── IsEmptyTckTest.java
│ ├── MergeTckTest.java
│ ├── SingleTckTest.java
│ ├── ElementAtTckTest.java
│ ├── MergeWithSingleTckTest.java
│ ├── DelayTckTest.java
│ ├── ConcatTckTest.java
│ ├── IgnoreElementsTckTest.java
│ ├── SwitchMapTckTest.java
│ ├── UnsubscribeOnTckTest.java
│ ├── AmbTckTest.java
│ ├── ConcatIterableEagerTckTest.java
│ ├── ObserveOnTckTest.java
│ ├── ToListTckTest.java
│ ├── IntervalTckTest.java
│ ├── SwitchMapDelayErrorTckTest.java
│ ├── ToSortedListTckTest.java
│ ├── ConcatPublisherTckTest.java
│ ├── MergePublisherTckTest.java
│ ├── DelaySubscriptionTckTest.java
│ ├── MergeWithMaybeTckTest.java
│ ├── ConcatPublisherEagerTckTest.java
│ ├── TimerTckTest.java
│ ├── UsingTckTest.java
│ ├── MergeIterableTckTest.java
│ ├── PublishSelectorTckTest.java
│ └── ReplaySelectorTckTest.java
│ ├── flowable
│ └── FlowableEventStreamTest.java
│ ├── completable
│ └── CapturingUncaughtExceptionHandler.java
│ └── validators
│ └── ParameterNamesInClassesTest.java
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── docs
├── _Footer.md
├── The-RxJava-Android-Module.md
├── Scheduler.md
├── Observable.md
└── Subject.md
├── codecov.yml
├── .github
├── dependabot.yml
├── workflows
│ ├── gradle-wrapper-validation.yml
│ └── gradle_pr.yml
├── PULL_REQUEST_TEMPLATE.md
└── ISSUE_TEMPLATE.md
├── .gitattributes
├── SECURITY.md
├── COPYRIGHT
├── config
├── license
│ ├── HEADER
│ └── HEADER_JAVA
└── checkstyle
│ ├── suppressions.xml
│ └── checkstyle.xml
├── gradle.properties
├── CONTRIBUTING.md
└── .gitignore
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name='rxjava'
2 |
--------------------------------------------------------------------------------
/src/main/resources/META-INF/proguard/rxjava3.pro:
--------------------------------------------------------------------------------
1 | -dontwarn java.util.concurrent.Flow*
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReactiveX/RxJava/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/docs/_Footer.md:
--------------------------------------------------------------------------------
1 | **Copyright (c) 2016-present, RxJava Contributors.**
2 | [Twitter @RxJava](https://twitter.com/#!/RxJava) | [Gitter @RxJava](https://gitter.im/ReactiveX/RxJava)
3 |
--------------------------------------------------------------------------------
/docs/The-RxJava-Android-Module.md:
--------------------------------------------------------------------------------
1 | ## RxAndroid
2 |
3 | See the [RxAndroid](https://github.com/ReactiveX/RxAndroid) project page and the [the RxAndroid wiki](https://github.com/ReactiveX/RxAndroid/wiki) for details.
4 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | coverage:
2 | status:
3 | project:
4 | default:
5 | target: 95%
6 | threshold: 1%
7 |
8 | patch:
9 | default:
10 | target: 95%
11 | threshold: 1%
12 |
13 | changes: no
14 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
4 | networkTimeout=10000
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 |
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "daily"
8 |
9 | - package-ecosystem: "gradle"
10 | directory: "/"
11 | schedule:
12 | interval: "daily"
13 |
--------------------------------------------------------------------------------
/docs/Scheduler.md:
--------------------------------------------------------------------------------
1 | If you want to introduce multithreading into your cascade of Observable operators, you can do so by instructing those operators (or particular Observables) to operate on particular Schedulers.
2 |
3 | For more information about Schedulers, see [the ReactiveX `Scheduler` documentation page](http://reactivex.io/documentation/scheduler.html).
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set default behaviour, in case users don't have core.autocrlf set.
2 | * text=auto
3 |
4 | # Explicitly declare text files we want to always be normalized and converted
5 | # to native line endings on checkout.
6 | *.java text
7 | *.groovy text
8 | *.scala text
9 | *.clj text
10 | *.txt text
11 | *.md text
12 |
13 | # Denote all files that are truly binary and should not be modified.
14 | *.png binary
15 | *.jpg binary
16 |
--------------------------------------------------------------------------------
/.github/workflows/gradle-wrapper-validation.yml:
--------------------------------------------------------------------------------
1 | name: "Validate Gradle Wrapper"
2 | on: [push, pull_request]
3 |
4 | permissions:
5 | contents: read
6 |
7 | jobs:
8 | validation:
9 | name: "Validation"
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
13 | - uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 # v3.5.0
14 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
4 |
5 | Please disclose it at [security advisory](https://github.com/ReactiveX/RxJava/security/advisories/new).
6 |
7 | This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.
8 |
--------------------------------------------------------------------------------
/COPYRIGHT:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016-present, RxJava Contributors.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/config/license/HEADER:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016-present, RxJava Contributors.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
4 | compliance with the License. You may obtain a copy of the License at
5 |
6 | http://www.apache.org/licenses/LICENSE-2.0
7 |
8 | Unless required by applicable law or agreed to in writing, software distributed under the License is
9 | distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
10 | the License for the specific language governing permissions and limitations under the License.
11 |
--------------------------------------------------------------------------------
/config/checkstyle/suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/docs/Observable.md:
--------------------------------------------------------------------------------
1 | In RxJava an object that implements the _Observer_ interface _subscribes_ to an object of the _Observable_ class. Then that subscriber reacts to whatever item or sequence of items the Observable object _emits_. This pattern facilitates concurrent operations because it does not need to block while waiting for the Observable to emit objects, but instead it creates a sentry in the form of a subscriber that stands ready to react appropriately at whatever future time the Observable does so.
2 |
3 | For information about the Observable class, see [the Observable documentation page at ReactiveX.io](http://reactivex.io/documentation/observable.html).
--------------------------------------------------------------------------------
/config/license/HEADER_JAVA:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Thank you for contributing to RxJava. Before pressing the "Create Pull Request" button, please consider the following points:
2 |
3 | - [ ] Please give a description about what and why you are contributing, even if it's trivial.
4 |
5 | - [ ] Please include the issue list number(s) or other PR numbers in the description if you are contributing in response to those.
6 |
7 | - [ ] Please include a reasonable set of unit tests if you contribute new code or change an existing one. If you contribute an operator, (if applicable) please make sure you have tests for working with an `empty`, `just`, `range` of values as well as an `error` source, with and/or without backpressure and see if unsubscription/cancellation propagates correctly.
8 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/internal/fuseable/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Base interfaces and types for supporting operator-fusion.
16 | */
17 | package io.reactivex.rxjava3.internal.fuseable;
18 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/operators/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Classes and interfaces for writing advanced operators within and outside RxJava.
16 | */
17 |
18 | package io.reactivex.rxjava3.operators;
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/functions/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Functional interfaces of functions and actions of arity 0 to 9 and related
16 | * utility classes.
17 | */
18 | package io.reactivex.rxjava3.functions;
19 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/testsupport/SuppressUndeliverable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.testsupport;
15 |
16 | import java.lang.annotation.*;
17 |
18 | @Retention(RetentionPolicy.RUNTIME)
19 | @Target(ElementType.METHOD)
20 | public @interface SuppressUndeliverable {
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/plugins/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Contains the central plugin handler {@link io.reactivex.rxjava3.plugins.RxJavaPlugins}
16 | * class to hook into the lifecycle of the base reactive types and schedulers.
17 | */
18 | package io.reactivex.rxjava3.plugins;
19 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/parallel/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Contains the base type {@link io.reactivex.rxjava3.parallel.ParallelFlowable},
16 | * a sub-DSL for working with {@link io.reactivex.rxjava3.core.Flowable} sequences in parallel.
17 | */
18 | package io.reactivex.rxjava3.parallel;
19 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/annotations/Beta.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.annotations;
15 |
16 | /**
17 | * Indicates the feature is in beta state: it will be most likely stay but
18 | * the signature may change between versions without warning.
19 | */
20 | public @interface Beta {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/flowables/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Classes supporting the Flowable base reactive class:
16 | * {@link io.reactivex.rxjava3.flowables.ConnectableFlowable} and
17 | * {@link io.reactivex.rxjava3.flowables.GroupedFlowable}.
18 | */
19 | package io.reactivex.rxjava3.flowables;
20 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | group=io.reactivex.rxjava3
2 | version=3.0.0-SNAPSHOT
3 | description=RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
4 |
5 | POM_ARTIFACT_ID=rxjava
6 | POM_NAME=RxJava
7 | POM_PACKAGING=jar
8 |
9 | POM_DESCRIPTION=Reactive Extensions for Java
10 | POM_INCEPTION_YEAR=2013
11 |
12 | POM_URL=https://github.com/ReactiveX/RxJava
13 | POM_SCM_URL=https://github.com/ReactiveX/RxJava
14 | POM_SCM_CONNECTION=scm:git:git://github.com/ReactiveX/RxJava.git
15 | POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/ReactiveX/RxJava.git
16 |
17 | POM_LICENCE_NAME=The Apache Software License, Version 2.0
18 | POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
19 | POM_LICENCE_DIST=repo
20 |
21 | POM_DEVELOPER_ID=akarnokd
22 | POM_DEVELOPER_NAME=David Karnok
23 | POM_DEVELOPER_URL=https://github.com/akarnokd/
24 | POM_DEVELOPER_EMAIL=akarnokd@gmail.com
25 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/observables/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Classes supporting the Observable base reactive class:
16 | * {@link io.reactivex.rxjava3.observables.ConnectableObservable} and
17 | * {@link io.reactivex.rxjava3.observables.GroupedObservable}.
18 | */
19 | package io.reactivex.rxjava3.observables;
20 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/annotations/Experimental.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.annotations;
15 |
16 | /**
17 | * Indicates the feature is in experimental state: its existence, signature or behavior
18 | * might change without warning from one release to the next.
19 | */
20 | public @interface Experimental {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/internal/schedulers/NonBlockingThread.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.schedulers;
15 |
16 | /**
17 | * Marker interface to indicate blocking is not recommended while running
18 | * on a Scheduler with a thread type implementing it.
19 | */
20 | public interface NonBlockingThread {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/config/checkstyle/checkstyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/disposables/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Default implementations for {@link io.reactivex.rxjava3.disposables.Disposable Disposable}-based resource management
16 | * ({@code Disposable} container types) and utility classes to construct
17 | * {@link io.reactivex.rxjava3.disposables.Disposable Disposables} from callbacks and other types.
18 | */
19 | package io.reactivex.rxjava3.disposables;
20 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/internal/util/SuppressAnimalSniffer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.util;
15 |
16 | import java.lang.annotation.*;
17 |
18 | /**
19 | * Suppress errors by the AnimalSniffer plugin.
20 | */
21 | @Retention(RetentionPolicy.CLASS)
22 | @Documented
23 | @Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
24 | public @interface SuppressAnimalSniffer {
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/internal/schedulers/ExecutorSchedulerInternalTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.schedulers;
15 |
16 | import static org.junit.Assert.assertNotNull;
17 |
18 | import org.junit.Test;
19 |
20 | public class ExecutorSchedulerInternalTest {
21 |
22 | @Test
23 | public void helperHolder() {
24 | assertNotNull(new ExecutorScheduler.SingleHolder());
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/annotations/CheckReturnValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.annotations;
15 |
16 | import java.lang.annotation.*;
17 |
18 | /**
19 | * Marks methods whose return values should be checked.
20 | *
History: 2.0.2 - experimental
21 | * @since 2.1
22 | */
23 | @Retention(RetentionPolicy.RUNTIME)
24 | @Documented
25 | @Target(ElementType.METHOD)
26 | public @interface CheckReturnValue {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeMergeWithTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.operators.maybe;
15 |
16 | import org.junit.Test;
17 |
18 | import io.reactivex.rxjava3.core.*;
19 |
20 | public class MaybeMergeWithTest extends RxJavaTest {
21 |
22 | @Test
23 | public void normal() {
24 | Maybe.just(1).mergeWith(Maybe.just(2))
25 | .test()
26 | .assertResult(1, 2);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/RepeatTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class RepeatTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return Flowable.just(1).repeat(elements);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/flowable/FlowableEventStreamTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.flowable;
15 |
16 | import org.junit.Test;
17 |
18 | import io.reactivex.rxjava3.core.RxJavaTest;
19 | import io.reactivex.rxjava3.testsupport.TestHelper;
20 |
21 | public class FlowableEventStreamTest extends RxJavaTest {
22 | @Test
23 | public void constructorShouldBePrivate() {
24 | TestHelper.checkUtilityClass(FlowableEventStream.class);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/HideTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class HideTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return Flowable.range(0, (int)elements).hide();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/annotations/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Annotations for indicating operator behavior, API stability
16 | * ({@link io.reactivex.rxjava3.annotations.Experimental @Experimental} and {@link io.reactivex.rxjava3.annotations.Beta @Beta}) and
17 | * nullability indicators ({@link io.reactivex.rxjava3.annotations.Nullable Nullable} and {@link io.reactivex.rxjava3.annotations.NonNull NonNull}).
18 | */
19 | package io.reactivex.rxjava3.annotations;
20 |
--------------------------------------------------------------------------------
/docs/Subject.md:
--------------------------------------------------------------------------------
1 | A `Subject` is a sort of bridge or proxy that acts both as an `Subscriber` and as an `Observable`. 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.
2 |
3 | For more information about the varieties of Subject and how to use them, see [the ReactiveX `Subject` documentation](http://reactivex.io/documentation/subject.html).
4 |
5 | #### Serializing
6 | When you use a Subject as a Subscriber, take care not to call its `onNext( )` method (or its other `on` 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.
7 |
8 | To protect a Subject from this danger, you can convert it into a [`SerializedSubject`](http://reactivex.io/RxJava/javadoc/rx/subjects/SerializedSubject.html) with code like the following:
9 |
10 | ```java
11 | mySafeSubject = new SerializedSubject( myUnsafeSubject );
12 | ```
13 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/FromIterableTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class FromIterableTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return Flowable.fromIterable(iterate(elements));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/functions/Cancellable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.functions;
15 |
16 | /**
17 | * A functional interface that has a single cancel method
18 | * that can throw.
19 | */
20 | @FunctionalInterface
21 | public interface Cancellable {
22 |
23 | /**
24 | * Cancel the action or free a resource.
25 | * @throws Throwable if the implementation wishes to throw any type of exception
26 | */
27 | void cancel() throws Throwable;
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/internal/observers/InnerQueuedObserverTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.observers;
15 |
16 | import org.junit.Test;
17 |
18 | import io.reactivex.rxjava3.core.RxJavaTest;
19 | import io.reactivex.rxjava3.testsupport.TestHelper;
20 |
21 | public class InnerQueuedObserverTest extends RxJavaTest {
22 |
23 | @Test
24 | public void dispose() {
25 | TestHelper.checkDisposed(new InnerQueuedObserver<>(null, 1));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/functions/Action.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.functions;
15 |
16 | /**
17 | * A functional interface similar to Runnable but allows throwing a checked exception.
18 | */
19 | @FunctionalInterface
20 | public interface Action {
21 | /**
22 | * Runs the action and optionally throws a checked exception.
23 | * @throws Throwable if the implementation wishes to throw any type of exception
24 | */
25 | void run() throws Throwable;
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/internal/util/ErrorMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.util;
15 |
16 | /**
17 | * Indicates when an error from the main source should be reported.
18 | */
19 | public enum ErrorMode {
20 | /** Report the error immediately, cancelling the active inner source. */
21 | IMMEDIATE,
22 | /** Report error after an inner source terminated. */
23 | BOUNDARY,
24 | /** Report the error after all sources terminated. */
25 | END
26 | }
27 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/internal/operators/mixed/ScalarXMapZHelperTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.operators.mixed;
15 |
16 | import org.junit.Test;
17 |
18 | import io.reactivex.rxjava3.core.RxJavaTest;
19 | import io.reactivex.rxjava3.testsupport.TestHelper;
20 |
21 | public class ScalarXMapZHelperTest extends RxJavaTest {
22 |
23 | @Test
24 | public void utilityClass() {
25 | TestHelper.checkUtilityClass(ScalarXMapZHelper.class);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/RangeTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class RangeTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/ShareTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class ShareTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).share()
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Thanks for using RxJava but before you post an issue, please consider the following points:
2 |
3 | - [ ] Please include the library version number, including the minor and patch version, in the issue text. In addition, if you'd include the major version in the title (such as `3.x`) that would be great.
4 |
5 | - [ ] If you think you found a bug, please include a code sample that reproduces the problem. Dumping a stacktrace is usually not enough for us.
6 |
7 | - [ ] RxJava has more than 150 operators, we recommend searching the [javadoc](http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/Observable.html) for keywords of what you try to accomplish.
8 |
9 | - [ ] If you have a question/issue about a library/technology built on top of RxJava (such as Retrofit, RxNetty, etc.), please consider asking a question on StackOverflow first (then maybe on their issue list).
10 |
11 | - [ ] Questions like "how do I X with RxJava" are generally better suited for StackOverflow (where it may already have an answer).
12 |
13 | - [ ] Please avoid cross-posting questions on StackOverflow, this issue list, the Gitter room or the mailing list.
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/functions/BooleanSupplier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.functions;
15 |
16 | /**
17 | * A functional interface (callback) that returns a boolean value.
18 | */
19 | @FunctionalInterface
20 | public interface BooleanSupplier {
21 | /**
22 | * Returns a boolean value.
23 | * @return a boolean value
24 | * @throws Throwable if the implementation wishes to throw any type of exception
25 | */
26 | boolean getAsBoolean() throws Throwable; // NOPMD
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/RetryTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class RetryTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).retry(1)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/SortedTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class SortedTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).sorted()
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/operators/SimplePlainQueue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.operators;
15 |
16 | import io.reactivex.rxjava3.annotations.*;
17 |
18 | /**
19 | * Override of the {@link SimpleQueue} interface with no {@code throws Throwable} on {@code poll()}.
20 | *
21 | * @param the value type to offer and poll, not null
22 | * @since 3.1.1
23 | */
24 | public interface SimplePlainQueue<@NonNull T> extends SimpleQueue {
25 |
26 | @Nullable
27 | @Override
28 | T poll();
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/CacheTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class CacheTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.fromIterable(iterate(elements)).cache()
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/SkipTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class SkipTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements * 2).skip(elements)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/TakeTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class TakeTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements * 2).take(elements)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/functions/LongConsumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.functions;
15 |
16 | /**
17 | * A functional interface (callback) that consumes a primitive long value.
18 | */
19 | @FunctionalInterface
20 | public interface LongConsumer {
21 | /**
22 | * Consume a primitive long input.
23 | * @param t the primitive long value
24 | * @throws Throwable if the implementation wishes to throw any type of exception
25 | */
26 | void accept(long t) throws Throwable;
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/LimitTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class LimitTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements * 2).take(elements)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/PublishTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class PublishTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).publish().autoConnect()
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/ReplayTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class ReplayTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).replay().autoConnect()
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/internal/util/ConnectConsumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.util;
15 |
16 | import io.reactivex.rxjava3.disposables.Disposable;
17 | import io.reactivex.rxjava3.functions.Consumer;
18 |
19 | /**
20 | * Store the Disposable received from the connection.
21 | */
22 | public final class ConnectConsumer implements Consumer {
23 | public Disposable disposable;
24 |
25 | @Override
26 | public void accept(Disposable t) {
27 | this.disposable = t;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/SkipLastTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class SkipLastTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements * 2).skipLast((int)elements)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/SkipUntilTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class SkipUntilTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).skipUntil(Flowable.just(1))
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/TakeLastTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class TakeLastTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements * 2).takeLast((int)elements)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/TakeUntilTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class TakeUntilTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).takeUntil(Flowable.never())
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/DefaultIfEmptyTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class DefaultIfEmptyTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(1, (int)elements).defaultIfEmpty(0)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/RebatchRequestsTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class RebatchRequestsTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).rebatchRequests(2)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/OnErrorReturnItemTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class OnErrorReturnItemTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).onErrorReturnItem(0)
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeSubscribeOnTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.operators.maybe;
15 |
16 | import org.junit.Test;
17 |
18 | import io.reactivex.rxjava3.core.*;
19 | import io.reactivex.rxjava3.schedulers.Schedulers;
20 | import io.reactivex.rxjava3.testsupport.TestHelper;
21 |
22 | public class MaybeSubscribeOnTest extends RxJavaTest {
23 |
24 | @Test
25 | public void dispose() {
26 | TestHelper.checkDisposed(Maybe.just(1).subscribeOn(Schedulers.single()));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/OnBackpressureBufferTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class OnBackpressureBufferTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).onBackpressureBuffer()
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/annotations/NonNull.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.annotations;
15 |
16 | import static java.lang.annotation.ElementType.*;
17 | import static java.lang.annotation.RetentionPolicy.CLASS;
18 |
19 | import java.lang.annotation.*;
20 |
21 | /**
22 | * Indicates that a field/parameter/variable/type parameter/return type is never null.
23 | */
24 | @Documented
25 | @Target(value = {FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_PARAMETER, TYPE_USE})
26 | @Retention(value = CLASS)
27 | public @interface NonNull { }
28 |
29 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/annotations/Nullable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.annotations;
15 |
16 | import static java.lang.annotation.ElementType.*;
17 | import static java.lang.annotation.RetentionPolicy.CLASS;
18 |
19 | import java.lang.annotation.*;
20 |
21 | /**
22 | * Indicates that a field/parameter/variable/type parameter/return type may be null.
23 | */
24 | @Documented
25 | @Target(value = {FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_PARAMETER, TYPE_USE})
26 | @Retention(value = CLASS)
27 | public @interface Nullable { }
28 |
29 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/MergeWithMaybeEmptyTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.*;
20 |
21 | @Test
22 | public class MergeWithMaybeEmptyTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.rangeLong(1, elements)
28 | .mergeWith(Maybe.empty())
29 | ;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/SwitchIfEmptyTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class SwitchIfEmptyTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.empty().switchIfEmpty(Flowable.range(1, (int)elements))
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/schedulers/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | /**
15 | * Contains notably the factory class of {@link io.reactivex.rxjava3.schedulers.Schedulers Schedulers} providing methods for
16 | * retrieving the standard scheduler instances, the {@link io.reactivex.rxjava3.schedulers.TestScheduler TestScheduler} for testing flows
17 | * with scheduling in a controlled manner and the class {@link io.reactivex.rxjava3.schedulers.Timed Timed} that can hold
18 | * a value and a timestamp associated with it.
19 | */
20 | package io.reactivex.rxjava3.schedulers;
21 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/EmptyTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class EmptyTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(final long elements) {
26 | return Flowable.empty();
27 | }
28 |
29 | @Override
30 | public long maxElementsFromPublisher() {
31 | return 0;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/MergeWithCompletableTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.*;
20 |
21 | @Test
22 | public class MergeWithCompletableTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.rangeLong(1, elements)
28 | .mergeWith(Completable.complete())
29 | ;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/OnErrorResumeWithTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class OnErrorResumeWithTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements).onErrorResumeWith(Flowable.never())
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/internal/operators/single/SingleFromUnsafeSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.operators.single;
15 |
16 | import io.reactivex.rxjava3.core.*;
17 |
18 | public final class SingleFromUnsafeSource extends Single {
19 | final SingleSource source;
20 |
21 | public SingleFromUnsafeSource(SingleSource source) {
22 | this.source = source;
23 | }
24 |
25 | @Override
26 | protected void subscribeActual(SingleObserver super T> observer) {
27 | source.subscribe(observer);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/DistinctUntilChangedTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 |
21 | @Test
22 | public class DistinctUntilChangedTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(long elements) {
26 | return
27 | Flowable.range(0, (int)elements)
28 | .distinctUntilChanged()
29 | ;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/internal/observers/EmptyCompletableObserverTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.observers;
15 |
16 | import static org.junit.Assert.assertFalse;
17 |
18 | import org.junit.Test;
19 |
20 | import io.reactivex.rxjava3.core.RxJavaTest;
21 |
22 | public final class EmptyCompletableObserverTest extends RxJavaTest {
23 |
24 | @Test
25 | public void defaultShouldReportNoCustomOnError() {
26 | EmptyCompletableObserver o = new EmptyCompletableObserver();
27 |
28 | assertFalse(o.hasCustomOnError());
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/CompletableAndThenPublisherTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import org.reactivestreams.Publisher;
17 | import org.testng.annotations.Test;
18 |
19 | import io.reactivex.rxjava3.core.*;
20 |
21 | @Test
22 | public class CompletableAndThenPublisherTckTest extends BaseTck {
23 |
24 | @Override
25 | public Publisher createPublisher(final long elements) {
26 | return
27 | Completable.complete().hide().andThen(Flowable.range(0, (int)elements))
28 | ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/io/reactivex/rxjava3/tck/TimeoutTckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.tck;
15 |
16 | import java.util.concurrent.TimeUnit;
17 |
18 | import org.reactivestreams.Publisher;
19 | import org.testng.annotations.Test;
20 |
21 | import io.reactivex.rxjava3.core.Flowable;
22 |
23 | @Test
24 | public class TimeoutTckTest extends BaseTck {
25 |
26 | @Override
27 | public Publisher createPublisher(long elements) {
28 | return
29 | Flowable.range(0, (int)elements).timeout(1, TimeUnit.DAYS)
30 | ;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/functions/Consumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.functions;
15 |
16 | import io.reactivex.rxjava3.annotations.NonNull;
17 |
18 | /**
19 | * A functional interface (callback) that accepts a single value.
20 | * @param the value type
21 | */
22 | @FunctionalInterface
23 | public interface Consumer<@NonNull T> {
24 | /**
25 | * Consume the given value.
26 | * @param t the value
27 | * @throws Throwable if the implementation wishes to throw any type of exception
28 | */
29 | void accept(T t) throws Throwable;
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/internal/observers/InnerQueuedObserverSupport.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.observers;
15 |
16 | /**
17 | * Interface to allow the InnerQueuedSubscriber to call back a parent
18 | * with signals.
19 | *
20 | * @param the value type
21 | */
22 | public interface InnerQueuedObserverSupport {
23 |
24 | void innerNext(InnerQueuedObserver inner, T value);
25 |
26 | void innerError(InnerQueuedObserver inner, Throwable e);
27 |
28 | void innerComplete(InnerQueuedObserver inner);
29 |
30 | void drain();
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/io/reactivex/rxjava3/internal/util/HashMapSupplier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present, RxJava Contributors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 | * compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 | * the License for the specific language governing permissions and limitations under the License.
12 | */
13 |
14 | package io.reactivex.rxjava3.internal.util;
15 |
16 | import java.util.*;
17 |
18 | import io.reactivex.rxjava3.functions.Supplier;
19 |
20 | public enum HashMapSupplier implements Supplier