Skip to content

Commit ab6d44c

Browse files
committed
Generify the LoggingCallback
1 parent 09ac86f commit ab6d44c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

api-client/src/main/kotlin/de/gesellix/docker/remote/api/client/ExecApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class ExecApi(dockerClientConfig: DockerClientConfig = defaultClientConfig, prox
246246

247247
// TODO the caller of #execStart() should decide about timeout and callback
248248
val timeout = Duration.of(1, ChronoUnit.HOURS)
249-
val callback = LoggingCallback()
249+
val callback = LoggingCallback<Frame>()
250250

251251
when (localVarResponse.responseType) {
252252
ResponseType.Success -> {

api-client/src/main/kotlin/de/gesellix/docker/remote/api/client/ImageApi.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class ImageApi(dockerClientConfig: DockerClientConfig = defaultClientConfig, pro
234234
// from either `aux ID=sha:.*`,
235235
// or `stream Successfully built .*`,
236236
// or `stream Successfully tagged .*` messages.
237-
val callback = LoggingCallback()
237+
val callback = LoggingCallback<Any>()
238238

239239
return when (localVarResponse.responseType) {
240240
ResponseType.Success -> {
@@ -568,7 +568,7 @@ class ImageApi(dockerClientConfig: DockerClientConfig = defaultClientConfig, pro
568568
)
569569

570570
val timeout = Duration.of(1, ChronoUnit.MINUTES)
571-
val callback = LoggingCallback()
571+
val callback = LoggingCallback<Any>()
572572

573573
return when (localVarResponse.responseType) {
574574
ResponseType.Success -> {
@@ -992,7 +992,7 @@ class ImageApi(dockerClientConfig: DockerClientConfig = defaultClientConfig, pro
992992
)
993993

994994
val timeout = Duration.of(1, ChronoUnit.MINUTES)
995-
val callback = LoggingCallback()
995+
val callback = LoggingCallback<Any>()
996996

997997
return when (localVarResponse.responseType) {
998998
ResponseType.Success -> {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package de.gesellix.docker.remote.api.core
22

3-
class LoggingCallback : StreamCallback<Any?> {
3+
class LoggingCallback<T> : StreamCallback<T?> {
44

55
private val log by logger()
66

@@ -9,7 +9,7 @@ class LoggingCallback : StreamCallback<Any?> {
99
job = cancellable
1010
}
1111

12-
override fun onNext(event: Any?) {
12+
override fun onNext(event: T?) {
1313
log.info("$event")
1414
}
1515
}

0 commit comments

Comments
 (0)