Class MultiTaskSession

  • All Implemented Interfaces:
    AutoCloseable, Runnable, Session

    @Deprecated
    public class MultiTaskSession
    extends AbstractSession
    Deprecated.
    As of release 3.8.0, not replaced.
    A Session implementation that queues tasks given to it and executes them in a serial fashion within the same thread which thus allows multiple tasks to be executed in the same transaction. The first SessionTask to execute is supplied on the constructor and additional ones may be added as they arrive with submitTask(SessionTask) where they will be added to a queue where they will await execution in the thread bound to this session.
    • Constructor Detail

      • MultiTaskSession

        public MultiTaskSession​(SessionTask initialSessionTask,
                                String sessionId,
                                ConcurrentMap<String,​Session> sessions)
        Deprecated.
        Creates a new MultiTaskSession object providing the initial starting SessionTask that gets executed by the session when it starts.
        Parameters:
        initialSessionTask - The tasks that starts the session.
        sessionId - The id of the session
        sessions - The session id to Session instances mapping
    • Method Detail

      • isAcceptingTasks

        public boolean isAcceptingTasks()
        Deprecated.
        Description copied from interface: Session
        Determines if this session can accept additional tasks or not.
      • sendTimeoutResponseForUncommencedTask

        public void sendTimeoutResponseForUncommencedTask()
        Deprecated.
        Description copied from class: AbstractSession
        Respond to the client with the specific timeout response for this Session implementation. This is for situations where the Session hasn't started running.
        Specified by:
        sendTimeoutResponseForUncommencedTask in class AbstractSession
      • run

        public void run()
        Deprecated.
      • close

        public void close()
        Deprecated.
        This method stops incoming requests from being added to the session queue. It then cancels the session lifetime timeout and then calls {@link super#close()} which will then interrupt this run() which will clear out remaining requests in the queue. This latter part of the close, where the interruption is concerned, is an asynchronous operation and will not block as it finishes its processing in the "gremlinPool" thread that was originally handling the work.
        Specified by:
        close in interface AutoCloseable
        Overrides:
        close in class AbstractSession