Interface RequestSubmitterAsync

  • All Known Implementing Classes:
    Client, Client.AliasClusteredClient, Client.ClusteredClient, Client.PinnedClient

    public interface RequestSubmitterAsync
    Defines the asynchronous request submission contract for Gremlin requests.

    This interface is implemented by Client to provide non-blocking request submission. The returned CompletableFuture completes when the write of the request is complete, not when the response is received.

    Note: Transaction classes intentionally do not implement this interface because transactional operations require sequential execution to maintain ordering guarantees over HTTP.

    For synchronous submission, see RequestSubmitter.

    • Method Detail

      • submitAsync

        CompletableFuture<ResultSet> submitAsync​(String gremlin)
        Submits a Gremlin script asynchronously.

        The returned future completes when the write of the request is complete.

        Parameters:
        gremlin - the Gremlin script to execute
        Returns:
        a future that completes with the results when the request write is complete
      • submitAsync

        CompletableFuture<ResultSet> submitAsync​(String gremlin,
                                                 Map<String,​Object> parameters)
        Submits a Gremlin script with bound parameters asynchronously.

        Prefer this method over string concatenation when executing scripts with variable arguments, as parameterized scripts perform better.

        Parameters:
        gremlin - the Gremlin script to execute
        parameters - a map of parameters that will be bound to the script on execution
        Returns:
        a future that completes with the results when the request write is complete
      • submitAsync

        CompletableFuture<ResultSet> submitAsync​(String gremlin,
                                                 RequestOptions options)
        Submits a Gremlin script with request options asynchronously.
        Parameters:
        gremlin - the Gremlin script to execute
        options - the options to supply for this request
        Returns:
        a future that completes with the results when the request write is complete