Debian Codegraph @

src/main/java/io/reactivex/rxjava3/annotations/SchedulerSupport.java

raw
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 import io.reactivex.rxjava3.schedulers.Schedulers;
19
20 /**
21 * Indicates what kind of scheduler the class or method uses.
22 * <p>
23 * Constants are provided for instances from {@link Schedulers} as well as values for
24 * {@linkplain #NONE not using a scheduler} and {@linkplain #CUSTOM a manually-specified scheduler}.
25 * Libraries providing their own values should namespace them with their base package name followed
26 * by a colon ({@code :}) and then a human-readable name (e.g., {@code com.example:ui-thread}).
27 * @since 2.0
28 */
29 @Retention(RetentionPolicy.RUNTIME)
30 @Documented
31 @Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE})
32 public @interface SchedulerSupport {
33 /**
34 * A special value indicating the operator/class doesn't use schedulers.
35 */
36 String NONE = "none";
37 /**
38 * A special value indicating the operator/class requires a scheduler to be manually specified.
39 */
40 String CUSTOM = "custom";
41
42 // Built-in schedulers:
43 /**
44 * The operator/class runs on RxJava's {@linkplain Schedulers#computation() computation
45 * scheduler} or takes timing information from it.
46 */
47 String COMPUTATION = "io.reactivex:computation";
48 /**
49 * The operator/class runs on RxJava's {@linkplain Schedulers#io() I/O scheduler} or takes
50 * timing information from it.
51 */
52 String IO = "io.reactivex:io";
53 /**
54 * The operator/class runs on RxJava's {@linkplain Schedulers#newThread() new thread scheduler}
55 * or takes timing information from it.
56 */
57 String NEW_THREAD = "io.reactivex:new-thread";
58 /**
59 * The operator/class runs on RxJava's {@linkplain Schedulers#trampoline() trampoline scheduler}
60 * or takes timing information from it.
61 */
62 String TRAMPOLINE = "io.reactivex:trampoline";
63 /**
64 * The operator/class runs on RxJava's {@linkplain Schedulers#single() single scheduler}
65 * or takes timing information from it.
66 * <p>History: 2.0.8 - experimental
67 * @since 2.2
68 */
69 String SINGLE = "io.reactivex:single";
70
71 /**
72 * The kind of scheduler the class or method uses.
73 * @return the name of the scheduler the class or method uses
74 */
75 String value();
76 }