Procházet zdrojové kódy

Hide WIP async methods in experimental interface

tags/v0.10.1
Chris Smith před 5 roky
rodič
revize
7666e3ff4f

+ 1
- 0
CHANGELOG Zobrazit soubor

4
  * Added sendPart method
4
  * Added sendPart method
5
  * Fix occasional ConcurrentModificationException when adding state
5
  * Fix occasional ConcurrentModificationException when adding state
6
  * (Internal) Moved message processors into their own package
6
  * (Internal) Moved message processors into their own package
7
+ * (Internal) Added ExperimentalIrcClient interface for features not yet ready for release
7
 
8
 
8
 v0.10.0
9
 v0.10.0
9
 
10
 

+ 37
- 33
src/main/kotlin/com/dmdirc/ktirc/IrcClient.kt Zobrazit soubor

89
      */
89
      */
90
     fun send(command: String, vararg arguments: String) = send(emptyMap(), command, *arguments)
90
     fun send(command: String, vararg arguments: String) = send(emptyMap(), command, *arguments)
91
 
91
 
92
-    /**
93
-     * Sends the given command to the IRC server, and waits for a response back.
94
-     *
95
-     * This should only be needed to send raw/custom commands; standard messages can be sent using the
96
-     * extension methods in [com.dmdirc.ktirc.messages] such as TODO: sendJoinAsync.
97
-     *
98
-     * This method will return immediately. If the server supports the labeled-responses capability,
99
-     * the returned [Deferred] will be eventually populated with the response from the server. If
100
-     * the server does not support the capability, or the response times out, `null` will be supplied.
101
-     *
102
-     * @param command The command to be sent.
103
-     * @param arguments The arguments to the command.
104
-     * @return A deferred [IrcEvent]? that contains the server's response to the command.
105
-     */
106
-    fun sendAsync(command: String, vararg arguments: String) = sendAsync(emptyMap(),  command, *arguments)
107
-
108
-    /**
109
-     * Sends the given command to the IRC server, and waits for a response back.
110
-     *
111
-     * This should only be needed to send raw/custom commands; standard messages can be sent using the
112
-     * extension methods in [com.dmdirc.ktirc.messages] such as TODO: sendJoinAsync.
113
-     *
114
-     * This method will return immediately. If the server supports the labeled-responses capability,
115
-     * the returned [Deferred] will be eventually populated with the response from the server. If
116
-     * the server does not support the capability, or the response times out, `null` will be supplied.
117
-     *
118
-     * @param tags The IRCv3 tags to prefix the message with, if any.
119
-     * @param command The command to be sent.
120
-     * @param arguments The arguments to the command.
121
-     * @return A deferred [IrcEvent]? that contains the server's response to the command.
122
-     */
123
-    fun sendAsync(tags: Map<MessageTag, String>, command: String, vararg arguments: String): Deferred<IrcEvent?>
124
-
125
     /**
92
     /**
126
      * Registers a new handler for all events on this connection.
93
      * Registers a new handler for all events on this connection.
127
      *
94
      *
161
 
128
 
162
 }
129
 }
163
 
130
 
131
+internal interface ExperimentalIrcClient : IrcClient {
132
+
133
+    /**
134
+     * Sends the given command to the IRC server, and waits for a response back.
135
+     *
136
+     * This should only be needed to send raw/custom commands; standard messages can be sent using the
137
+     * extension methods in [com.dmdirc.ktirc.messages] such as TODO: sendJoinAsync.
138
+     *
139
+     * This method will return immediately. If the server supports the labeled-responses capability,
140
+     * the returned [Deferred] will be eventually populated with the response from the server. If
141
+     * the server does not support the capability, or the response times out, `null` will be supplied.
142
+     *
143
+     * @param command The command to be sent.
144
+     * @param arguments The arguments to the command.
145
+     * @return A deferred [IrcEvent]? that contains the server's response to the command.
146
+     */
147
+    fun sendAsync(command: String, vararg arguments: String) = sendAsync(emptyMap(),  command, *arguments)
148
+
149
+    /**
150
+     * Sends the given command to the IRC server, and waits for a response back.
151
+     *
152
+     * This should only be needed to send raw/custom commands; standard messages can be sent using the
153
+     * extension methods in [com.dmdirc.ktirc.messages] such as TODO: sendJoinAsync.
154
+     *
155
+     * This method will return immediately. If the server supports the labeled-responses capability,
156
+     * the returned [Deferred] will be eventually populated with the response from the server. If
157
+     * the server does not support the capability, or the response times out, `null` will be supplied.
158
+     *
159
+     * @param tags The IRCv3 tags to prefix the message with, if any.
160
+     * @param command The command to be sent.
161
+     * @param arguments The arguments to the command.
162
+     * @return A deferred [IrcEvent]? that contains the server's response to the command.
163
+     */
164
+    fun sendAsync(tags: Map<MessageTag, String>, command: String, vararg arguments: String): Deferred<IrcEvent?>
165
+
166
+}
167
+
164
 /**
168
 /**
165
  * Defines the behaviour of an [IrcClient].
169
  * Defines the behaviour of an [IrcClient].
166
  */
170
  */

+ 1
- 1
src/main/kotlin/com/dmdirc/ktirc/IrcClientImpl.kt Zobrazit soubor

27
  */
27
  */
28
 // TODO: How should alternative nicknames work?
28
 // TODO: How should alternative nicknames work?
29
 // TODO: Should IRC Client take a pool of servers and rotate through, or make the caller do that?
29
 // TODO: Should IRC Client take a pool of servers and rotate through, or make the caller do that?
30
-internal class IrcClientImpl(private val config: IrcClientConfig) : IrcClient, CoroutineScope {
30
+internal class IrcClientImpl(private val config: IrcClientConfig) : ExperimentalIrcClient, CoroutineScope {
31
 
31
 
32
     private val log by logger()
32
     private val log by logger()
33
 
33
 

Načítá se…
Zrušit
Uložit