@@ -19,9 +19,8 @@ import org.axonframework.messaging.responsetypes.ResponseTypes
19
19
import org.axonframework.queryhandling.QueryGateway
20
20
import java.util.*
21
21
import java.util.concurrent.CompletableFuture
22
+ import java.util.concurrent.TimeUnit
22
23
import java.util.stream.Stream
23
- import kotlin.time.DurationUnit
24
- import kotlin.time.ExperimentalTime
25
24
26
25
/* *
27
26
* Reified version of [QueryGateway.query]
@@ -115,18 +114,17 @@ inline fun <reified R, reified Q> QueryGateway.queryForOptional(queryName: Strin
115
114
* which expects an Stream object as a response using [org.axonframework.messaging.responsetypes.InstanceResponseType]
116
115
* @param query Query to send
117
116
* @param timeout a timeout for the query
118
- * @param durationUnit the selected DurationUnit for the given timeout
117
+ * @param timeUnit the selected TimeUnit for the given timeout
119
118
* @param [Q] the type of payload of the query
120
119
* @param [R] the response class contained in the given responseType
121
120
* @return [Stream] a stream of results
122
121
* @see QueryGateway.scatterGather
123
122
* @see ResponseTypes
124
123
* @since 0.2.0
125
124
*/
126
- @ExperimentalTime
127
125
inline fun <reified R , reified Q > QueryGateway.scatterGatherForSingle (query : Q , timeout : Long ,
128
- durationUnit : DurationUnit ): Stream <R > {
129
- return this .scatterGather(query, ResponseTypes .instanceOf(R ::class .java), timeout, durationUnit )
126
+ timeUnit : TimeUnit ): Stream <R > {
127
+ return this .scatterGather(query, ResponseTypes .instanceOf(R ::class .java), timeout, timeUnit )
130
128
}
131
129
132
130
/* *
@@ -135,37 +133,35 @@ inline fun <reified R, reified Q> QueryGateway.scatterGatherForSingle(query: Q,
135
133
* @param query Query to send
136
134
* @param queryName Name of the query
137
135
* @param timeout a timeout for the query
138
- * @param durationUnit the selected DurationUnit for the given timeout
136
+ * @param timeUnit the selected TimeUnit for the given timeout
139
137
* @param [Q] the type of payload of the query
140
138
* @param [R] the response class contained in the given responseType
141
139
* @return [Stream] a stream of results
142
140
* @see QueryGateway.scatterGather
143
141
* @see ResponseTypes
144
142
* @since 0.2.0
145
143
*/
146
- @ExperimentalTime
147
144
inline fun <reified R , reified Q > QueryGateway.scatterGatherForSingle (queryName : String , query : Q , timeout : Long ,
148
- durationUnit : DurationUnit ): Stream <R > {
149
- return this .scatterGather(queryName, query, ResponseTypes .instanceOf(R ::class .java), timeout, durationUnit )
145
+ timeUnit : TimeUnit ): Stream <R > {
146
+ return this .scatterGather(queryName, query, ResponseTypes .instanceOf(R ::class .java), timeout, timeUnit )
150
147
}
151
148
152
149
/* *
153
150
* Reified version of [QueryGateway.scatterGather]
154
151
* which expects a collection as a response using [org.axonframework.messaging.responsetypes.MultipleInstancesResponseType]
155
152
* @param query Query to send
156
153
* @param timeout a timeout for the query
157
- * @param durationUnit the selected DurationUnit for the given timeout
154
+ * @param timeUnit the selected TimeUnit for the given timeout
158
155
* @param [Q] the type of payload of the query
159
156
* @param [R] the response class contained in the given responseType
160
157
* @return [Stream] a stream of results
161
158
* @see QueryGateway.scatterGather
162
159
* @see ResponseTypes
163
160
* @since 0.2.0
164
161
*/
165
- @ExperimentalTime
166
162
inline fun <reified R , reified Q > QueryGateway.scatterGatherForMultiple (query : Q , timeout : Long ,
167
- durationUnit : DurationUnit ): Stream <List <R >> {
168
- return this .scatterGather(query, ResponseTypes .multipleInstancesOf(R ::class .java), timeout, durationUnit )
163
+ timeUnit : TimeUnit ): Stream <List <R >> {
164
+ return this .scatterGather(query, ResponseTypes .multipleInstancesOf(R ::class .java), timeout, timeUnit )
169
165
}
170
166
171
167
/* *
@@ -174,37 +170,35 @@ inline fun <reified R, reified Q> QueryGateway.scatterGatherForMultiple(query: Q
174
170
* @param query Query to send
175
171
* @param queryName Name of the query
176
172
* @param timeout a timeout for the query
177
- * @param durationUnit the selected DurationUnit for the given timeout
173
+ * @param timeUnit the selected TimeUnit for the given timeout
178
174
* @param [Q] the type of payload of the query
179
175
* @param [R] the response class contained in the given responseType
180
176
* @return [Stream] a stream of results
181
177
* @see QueryGateway.scatterGather
182
178
* @see ResponseTypes
183
179
* @since 0.2.0
184
180
*/
185
- @ExperimentalTime
186
181
inline fun <reified R , reified Q > QueryGateway.scatterGatherForMultiple (queryName : String , query : Q , timeout : Long ,
187
- durationUnit : DurationUnit ): Stream <List <R >> {
188
- return this .scatterGather(queryName, query, ResponseTypes .multipleInstancesOf(R ::class .java), timeout, durationUnit )
182
+ timeUnit : TimeUnit ): Stream <List <R >> {
183
+ return this .scatterGather(queryName, query, ResponseTypes .multipleInstancesOf(R ::class .java), timeout, timeUnit )
189
184
}
190
185
191
186
/* *
192
187
* Reified version of [QueryGateway.scatterGather]
193
188
* which expects a collection as a response using [org.axonframework.messaging.responsetypes.OptionalResponseType]
194
189
* @param query Query to send
195
190
* @param timeout a timeout for the query
196
- * @param durationUnit the selected DurationUnit for the given timeout
191
+ * @param timeUnit the selected TimeUnit for the given timeout
197
192
* @param [Q] the type of payload of the query
198
193
* @param [R] the response class contained in the given responseType
199
194
* @return [Stream] a stream of results
200
195
* @see QueryGateway.scatterGather
201
196
* @see ResponseTypes
202
197
* @since 0.2.0
203
198
*/
204
- @ExperimentalTime
205
199
inline fun <reified R , reified Q > QueryGateway.scatterGatherForOptional (query : Q , timeout : Long ,
206
- durationUnit : DurationUnit ): Stream <Optional <R >> {
207
- return this .scatterGather(query, ResponseTypes .optionalInstanceOf(R ::class .java), timeout, durationUnit )
200
+ timeUnit : TimeUnit ): Stream <Optional <R >> {
201
+ return this .scatterGather(query, ResponseTypes .optionalInstanceOf(R ::class .java), timeout, timeUnit )
208
202
}
209
203
210
204
/* *
@@ -213,16 +207,15 @@ inline fun <reified R, reified Q> QueryGateway.scatterGatherForOptional(query: Q
213
207
* @param query Query to send
214
208
* @param queryName Name of the query
215
209
* @param timeout a timeout for the query
216
- * @param durationUnit the selected DurationUnit for the given timeout
210
+ * @param timeUnit the selected TimeUnit for the given timeout
217
211
* @param [Q] the type of payload of the query
218
212
* @param [R] the response class contained in the given responseType
219
213
* @return [Stream] a stream of results
220
214
* @see QueryGateway.scatterGather
221
215
* @see ResponseTypes
222
216
* @since 0.2.0
223
217
*/
224
- @ExperimentalTime
225
218
inline fun <reified R , reified Q > QueryGateway.scatterGatherForOptional (queryName : String , query : Q , timeout : Long ,
226
- durationUnit : DurationUnit ): Stream <Optional <R >> {
227
- return this .scatterGather(queryName, query, ResponseTypes .optionalInstanceOf(R ::class .java), timeout, durationUnit )
219
+ timeUnit : TimeUnit ): Stream <Optional <R >> {
220
+ return this .scatterGather(queryName, query, ResponseTypes .optionalInstanceOf(R ::class .java), timeout, timeUnit )
228
221
}
0 commit comments