In the project I use RxJava , and sockets. From the first attempt, it was not possible to wrap the sockets in the Observable on its own, I began to ask if they told me to wrap it through Subject .
Later it turned out to be wrapped in simple Obsevable
return Observable.create { subscriber -> SocketService.mSocket.emit("add user", "name", Ack { response -> subscriber.onNext(response as JSONObject) }) } Everything works out. About sabzhekty can not understand whether to use them? If all the behavior that I need is to send responses from the callback, neither ReplaySubject nor Behavior ReplaySubject . Subscriber will be one.
I look at an example , but it seems to me that there are so many redundant actions.