Wrap a observable.
@param source The source
@param instrumentations The instrumentations
@param <T> The type
@return The wrapped subscriber
359585
static <T> Observable<T> wrap(
            ObservableSource<T> source, Collection<ReactiveInstrumenter> instrumentations) {
        if (source instanceof Callable) {
            return new RxInstrumentedCallableObservable<>(source, instrumentations);
        }
        return new RxInstrumentedObservable<>(source, instrumentations);
    }
361699
@Override
  public <S,T> Convert<S,T> converter(Class<S> source, Class<T> target)
  {
    return _injectBuilder.get().converter().converter(source, target);
  }
1288989
public void addProviderListener(ConsumerConfig consumerConfig, ProviderInfoListener listener) {
        if (listener != null) {
            RegistryUtils.initOrAddList(providerListenerMap, consumerConfig, listener);
        }
    }
1036354
public <T extends EventListener> void subscribe(EventPublisher source, T listener) {
	if (source == null || listener == null) {
	    throw new IllegalArgumentException("Parameters cannot be null");
	}
	log.debug("[subscribe] Adding {} --> {}", source.getClass().getName(), listener.getClass().getName());

	GenericEventDispatcher<T> dispatcher = (GenericEventDispatcher<T>) dispatchers.get(source);
	if (dispatcher == null) {
	    log.warn("[subscribe] Registering with a disconnected source");
	    dispatcher = createDispatcher(source);
	}

	dispatcher.addListener(listener);

    }
1114340
public static <T extends Comparable<? super T>> Observable<T> max(
            Observable<T> source) {
        return minMax(source, -1);
    }
595983
public <B extends BackendObject> Observable<Integer> count(final Class<B> type){
        return getWebService().count(isLoggedIn(),Query.safeTable(type))
                .subscribeOn(config.subscribeOn()).observeOn(config.observeOn());
    }
583255
async function subscribe (ant, field, directiveArgs, fieldArgs) {
  if (ant && field && directiveArgs && directiveArgs.to) {
    const antFunction =  ant.functionController.getFunction(directiveArgs.to);
    if (!antFunction) {
      logger.error(new AntError(
        `Could not find "${directiveArgs.to}" function`
      ));
      return null;
    }
    try {
      const currentValue = antFunction.run(fieldArgs);
      if (currentValue instanceof Observable) {
        return new AsyncIterableObserver(field.fieldName, currentValue);
      }
      return currentValue;
    } catch (e) {
      logger.error(new AntError(
        `Could not run "${directiveArgs.to}" function`,
        e
      ));
    }
  }
  return null;
}
1238197
public static <T> FlowableTransformer<T,T> doOnSubscribeFx(Consumer<Subscription> subscribe) {
        return obs -> obs.doOnSubscribe((d -> runOnFx(d,subscribe)));
    }
1265288
function buildCompilers(config, deps, opts) {
    return Rx.Observable.concat(R.map(function (name) {
        var entry = config[name];
        if (isPlainObject(entry)) {
            var commonDeps = getCommonDeps(name, deps, opts);
            return Rx.Observable.concat(
                buildCommonCompiler(name, commonDeps, opts),
                buildCompilers(entry, getChildDeps(commonDeps), opts)
            );
        }
        return buildEntryCompiler(name, deps, opts);
    }, R.keys(config)));
}
837939
public void subscribe(ArrayList<Long> tokens) {
        if(ws != null) {
            if (ws.isOpen()) {
                createTickerJsonObject(tokens, mSubscribe);
                ws.sendText(createTickerJsonObject(tokens, mSubscribe).toString());
                subscribedTokens.addAll(tokens);
                for(int i = 0; i < tokens.size(); i++){
                    modeMap.put(tokens.get(i), modeQuote);
                }
            }else {
                if(onErrorListener != null) {
                    onErrorListener.onError(new KiteException("ticker is not connected", 504));
                }
            }
        }else {
            if(onErrorListener != null) {
                onErrorListener.onError(new KiteException("ticker is null not connected", 504));
            }
        }
    }
975845
public <T> Observable<T> asObservable(final Class<T> eventType) {
        return Observable.create(new OnSubscribe<T>() {
            @Override
            public void call(final Subscriber<? super T> observer) {
                final DynamicSubscriber consumer = new DynamicSubscriber() {
                    @Override
                    public Class<?> getEventType() {
                        return eventType;
                    }
                    
                    @Subscribe
                    public void consume(Object obj) {
                        observer.onNext((T) obj);
                    }
                };
                
                observer.add(BooleanSubscription.create(new Action0() {
                    @Override
                    public void call() {
                        eventBus.unregisterSubscriber(consumer);
                        observer.onCompleted();
                    }
                }));
                
                try {
                    eventBus.registerSubscriber(consumer);
                } catch (InvalidSubscriberException e) {
                    observer.onError(e);
                }
            }
        });
    }
855653
public PackageDoc wrap(PackageDoc source) {
		if (source == null || source instanceof Proxy<?> || !(source instanceof PackageDocImpl)) {
			return source;
		}
		return new PackageDocWrapper((PackageDocImpl) source);
	}
44417
@NonNull @CheckReturnValue private <T> ObservableTransformer<T, Permission> ensureEach(@NonNull final String... permissions) {
    checkPermissions(permissions);

    return new ObservableTransformer<T, Permission>() {
      @Override @NonNull @CheckReturnValue public ObservableSource<Permission> apply(final Observable<T> o) {
        return request(o, permissions);
      }
    };
  }
1026823
@SuppressWarnings("unchecked")
    public static <T> ConnectableObservable<T> createFrom(ObservableSource<? extends T> source) {
        ObservableSource<T> sourceCast = (ObservableSource<T>) source;
        return create(sourceCast, DEFAULT_UNBOUNDED_FACTORY);
    }
1004911
public static <T> ServiceFuture<T> fromResponse(final Observable<ServiceResponse<T>> observable, final ServiceCallback<T> callback) {
        final ServiceFuture<T> serviceFuture = new ServiceFuture<>();
        serviceFuture.subscription = observable
                .last()
                .subscribe(new Action1<ServiceResponse<T>>() {
                    @Override
                    public void call(ServiceResponse<T> t) {
                        if (callback != null) {
                            callback.success(t.body());
                        }
                        serviceFuture.set(t.body());
                    }
                }, new Action1<Throwable>() {
                    @Override
                    public void call(Throwable throwable) {
                        if (callback != null) {
                            callback.failure(throwable);
                        }
                        serviceFuture.setException(throwable);
                    }
                });
        return serviceFuture;
    }
1187346
public static <T> org.reactivestreams.Subscriber<T> toSubscriber(final rx.Subscriber<T> rxSubscriber) {
        return new SubscriberAdapter<T>(rxSubscriber);
    }
156715
<T extends RxComapiClient> Observable<T> initialise(@NonNull final Application application, CallbackAdapter adapter, @NonNull final T instance) {
        return super.initialise(application, instance, adapter);
    }