@Override public <R> void register(OperationId operationId, Supplier<R> callback) { checkNotNull(operationId, "operationId cannot be null"); checkNotNull(callback, "callback cannot be null"); handle(operationId, commit -> encode(callback.get())); }
@Override public <T, R> void register(OperationId operationId, Function<Commit<T>, R> callback) { checkNotNull(operationId, "operationId cannot be null"); checkNotNull(callback, "callback cannot be null"); handle(operationId, commit -> encode(callback.apply(commit.map(this::decode)))); }