-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathConnectionProvider.java
More file actions
34 lines (28 loc) · 887 Bytes
/
ConnectionProvider.java
File metadata and controls
34 lines (28 loc) · 887 Bytes
1
2
3
4
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
30
31
32
33
34
package ua.naiksoftware.stomp.provider;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Observable;
import ua.naiksoftware.stomp.dto.LifecycleEvent;
/**
* Created by naik on 05.05.16.
*/
public interface ConnectionProvider {
/**
* Subscribe this for receive stomp messages
*/
Observable<String> messages();
/**
* Sending stomp messages via you ConnectionProvider.
* onError if not connected or error detected will be called, or onCompleted id sending started
* TODO: send messages with ACK
*/
Completable send(String stompMessage);
/**
* Subscribe this for receive #LifecycleEvent events
*/
Observable<LifecycleEvent> lifecycle();
/**
* Disconnects from server. This is basically a Callable.
* Automatically emits Lifecycle.CLOSE
*/
Completable disconnect();
}