File tree Expand file tree Collapse file tree 10 files changed +29
-29
lines changed
chat-android/src/main/java/com/ably/chat Expand file tree Collapse file tree 10 files changed +29
-29
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ interface ConnectionStatus {
25
25
* Registers a listener that will be called whenever the connection status changes.
26
26
* @param listener The function to call when the status changes.
27
27
*/
28
- fun on (listener : Listener ): Cancellation
28
+ fun on (listener : Listener ): Subscription
29
29
30
30
/* *
31
31
* An interface for listening to changes for the connection status
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ interface EmitsDiscontinuities {
10
10
* Register a listener to be called when a discontinuity is detected.
11
11
* @param listener The listener to be called when a discontinuity is detected.
12
12
*/
13
- fun onDiscontinuity (listener : Listener ): Cancellation
13
+ fun onDiscontinuity (listener : Listener ): Subscription
14
14
15
15
/* *
16
16
* An interface for listening when discontinuity happens
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ data class SendMessageParams(
169
169
val headers : MessageHeaders ? = null ,
170
170
)
171
171
172
- interface MessagesSubscription : Cancellation {
172
+ interface MessagesSubscription : Subscription {
173
173
suspend fun getPreviousMessages (queryOptions : QueryOptions ): PaginatedResult <Message >
174
174
}
175
175
@@ -195,7 +195,7 @@ class DefaultMessages(
195
195
196
196
override suspend fun send (params : SendMessageParams ): Message = chatApi.sendMessage(roomId, params)
197
197
198
- override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Cancellation {
198
+ override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Subscription {
199
199
TODO (" Not yet implemented" )
200
200
}
201
201
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ interface Occupancy : EmitsDiscontinuities {
23
23
*
24
24
* @param listener A listener to be called when the occupancy of the room changes.
25
25
*/
26
- fun subscribe (listener : Listener ): Cancellation
26
+ fun subscribe (listener : Listener ): Subscription
27
27
28
28
/* *
29
29
* Get the current occupancy of the chat room.
@@ -65,15 +65,15 @@ internal class DefaultOccupancy(
65
65
override val channel: Channel
66
66
get() = messages.channel
67
67
68
- override fun subscribe (listener : Occupancy .Listener ): Cancellation {
68
+ override fun subscribe (listener : Occupancy .Listener ): Subscription {
69
69
TODO (" Not yet implemented" )
70
70
}
71
71
72
72
override suspend fun get (): OccupancyEvent {
73
73
TODO (" Not yet implemented" )
74
74
}
75
75
76
- override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Cancellation {
76
+ override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Subscription {
77
77
TODO (" Not yet implemented" )
78
78
}
79
79
}
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ interface Presence : EmitsDiscontinuities {
60
60
* Subscribe the given listener to all presence events.
61
61
* @param listener listener to subscribe
62
62
*/
63
- fun subscribe (listener : Listener ): Cancellation
63
+ fun subscribe (listener : Listener ): Subscription
64
64
65
65
/* *
66
66
* An interface for listening to new presence event
@@ -156,11 +156,11 @@ internal class DefaultPresence(
156
156
TODO (" Not yet implemented" )
157
157
}
158
158
159
- override fun subscribe (listener : Presence .Listener ): Cancellation {
159
+ override fun subscribe (listener : Presence .Listener ): Subscription {
160
160
TODO (" Not yet implemented" )
161
161
}
162
162
163
- override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Cancellation {
163
+ override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Subscription {
164
164
TODO (" Not yet implemented" )
165
165
}
166
166
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ interface RoomReactions : EmitsDiscontinuities {
38
38
* @param listener The listener function to be called when a reaction is received.
39
39
* @returns A response object that allows you to control the subscription.
40
40
*/
41
- fun subscribe (listener : Listener ): Cancellation
41
+ fun subscribe (listener : Listener ): Subscription
42
42
43
43
/* *
44
44
* An interface for listening to new reaction events
@@ -111,11 +111,11 @@ internal class DefaultRoomReactions(
111
111
TODO (" Not yet implemented" )
112
112
}
113
113
114
- override fun subscribe (listener : RoomReactions .Listener ): Cancellation {
114
+ override fun subscribe (listener : RoomReactions .Listener ): Subscription {
115
115
TODO (" Not yet implemented" )
116
116
}
117
117
118
- override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Cancellation {
118
+ override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Subscription {
119
119
TODO (" Not yet implemented" )
120
120
}
121
121
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ interface RoomStatus {
21
21
* @param listener The function to call when the status changes.
22
22
* @returns An object that can be used to unregister the listener.
23
23
*/
24
- fun on (listener : Listener ): Cancellation
24
+ fun on (listener : Listener ): Subscription
25
25
26
26
/* *
27
27
* An interface for listening to changes for the room status
Original file line number Diff line number Diff line change
1
+ package com.ably.chat
2
+
3
+ /* *
4
+ * An unsubscription handle, returned by various functions (mostly subscriptions)
5
+ * where unsubscription is required.
6
+ */
7
+ fun interface Subscription {
8
+ /* *
9
+ * Handle unsubscription (unsubscribe listeners, clean up)
10
+ */
11
+ fun unsubscribe ()
12
+ }
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ interface Typing : EmitsDiscontinuities {
37
37
*
38
38
* @param listener A listener to be called when the typing state of a user in the room changes.
39
39
*/
40
- fun subscribe (listener : Listener ): Cancellation
40
+ fun subscribe (listener : Listener ): Subscription
41
41
42
42
/* *
43
43
* Get the current typers, a set of clientIds.
@@ -84,7 +84,7 @@ internal class DefaultTyping(
84
84
override val channel: Channel
85
85
get() = realtimeClient.channels.get(typingIndicatorsChannelName, ChatChannelOptions ())
86
86
87
- override fun subscribe (listener : Typing .Listener ): Cancellation {
87
+ override fun subscribe (listener : Typing .Listener ): Subscription {
88
88
TODO (" Not yet implemented" )
89
89
}
90
90
@@ -100,7 +100,7 @@ internal class DefaultTyping(
100
100
TODO (" Not yet implemented" )
101
101
}
102
102
103
- override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Cancellation {
103
+ override fun onDiscontinuity (listener : EmitsDiscontinuities .Listener ): Subscription {
104
104
TODO (" Not yet implemented" )
105
105
}
106
106
}
You can’t perform that action at this time.
0 commit comments