/*
 * Copyright 2019 Immutables Authors and Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.immutables.criteria.internal;

import org.reactivestreams.Publisher;

/**
 * Abstraction of a asynchronous service used by adapters and modeled as a simple function (SAM).
 *
 * @param <Q> type of the query. Can be string or something more complicated
 * @param <T> type of the result (computation)
 */
public interface Backend<Q, T> {

  /**
   * Fetch (possibly unbounded) result of a computation.
   *
   * @param query payload
   * @return empty or unbounded flow of events
   */
  Publisher<T> execute(Q query);

}

@@ -777,21 +777,28 @@
 a si
-mple function
+ngle abstract method
  (SA
@@ -815,17 +815,17 @@
 @param %3C
-Q
+O
 %3E type o
@@ -834,58 +834,54 @@
 the 
-query. Can be string or something more complicated
+operation. Can be query / delete / update etc.
 %0A * 
@@ -953,17 +953,17 @@
 Backend%3C
-Q
+O
 , T%3E %7B%0A%0A
@@ -977,90 +977,199 @@
   * 
-Fetch (possibly unbounded) result of a computation.%0A   *%0A   * @param query payload
+Apply an operation on the back-end. %7B@code operation%7D in this context can mean query / update%0A   * / insert  / index etc.%0A   *%0A   * @param operation operation to be performed on the back-end.
 %0A   
@@ -1211,16 +1211,48 @@
 f events
+ (can also be a single response)
 %0A   */%0A 
@@ -1277,15 +1277,19 @@
 ute(
-Q query
+O operation
 );%0A%0A

Update javadoc for Backend interface also change parameter names