mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
fix tests for chronicle map on engine.
This commit is contained in:
@@ -3,13 +3,16 @@ package net.openhft.chronicle.map;
|
||||
import net.openhft.chronicle.engine.client.ClientWiredStatelessTcpConnectionHub;
|
||||
import net.openhft.chronicle.wire.CoreFields;
|
||||
import net.openhft.chronicle.wire.ParameterizeWireKey;
|
||||
import net.openhft.chronicle.wire.ValueIn;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Created by Rob Austin
|
||||
*/
|
||||
public abstract class MapStatelessClient< E extends ParameterizeWireKey> extends AbstactStatelessClient<E> {
|
||||
public abstract class MapStatelessClient<E extends ParameterizeWireKey> extends AbstactStatelessClient<E> {
|
||||
|
||||
/**
|
||||
* @param channelName
|
||||
@@ -28,14 +31,19 @@ public abstract class MapStatelessClient< E extends ParameterizeWireKey> extends
|
||||
@Nullable
|
||||
protected <R> R proxyReturnTypedObject(
|
||||
@NotNull final E eventId,
|
||||
R usingValue,
|
||||
@NotNull final Class<R> resultType,
|
||||
@Nullable Object... args) {
|
||||
|
||||
Function<ValueIn, R> consumerIn = resultType == CharSequence.class && usingValue != null
|
||||
? f -> {
|
||||
f.text((StringBuilder) usingValue);
|
||||
return usingValue;
|
||||
}
|
||||
: f -> f.object(resultType);
|
||||
return proxyReturnWireConsumerInOut(eventId,
|
||||
CoreFields.reply, toParameters(eventId, args),
|
||||
f -> f.object(resultType));
|
||||
|
||||
CoreFields.reply,
|
||||
toParameters(eventId, args),
|
||||
consumerIn);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user