-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
13 additions
and
7 deletions.
There are no files selected for viewing
5 changes: 3 additions & 2 deletions
5
services-api/src/main/java/io/scalecube/services/transport/api/DataCodec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
...ices-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageDataDecoder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
package io.scalecube.services.transport.api; | ||
|
||
import io.scalecube.services.api.ServiceMessage; | ||
import io.scalecube.utils.ServiceLoaderUtil; | ||
import java.util.ServiceLoader; | ||
import java.util.function.BiFunction; | ||
import java.util.stream.StreamSupport; | ||
|
||
@FunctionalInterface | ||
public interface ServiceMessageDataDecoder | ||
extends BiFunction<ServiceMessage, Class<?>, ServiceMessage> { | ||
|
||
ServiceMessageDataDecoder INSTANCE = | ||
ServiceLoaderUtil.findFirst(ServiceMessageDataDecoder.class).orElse(null); | ||
StreamSupport.stream(ServiceLoader.load(ServiceMessageDataDecoder.class).spliterator(), false) | ||
.findFirst() | ||
.orElse(null); | ||
} |