Interface BatchHandler


  • public interface BatchHandler
    Allows wrapping Listener.accept(List) and CursorManager.onSuccess(String, Cursor) inside one transaction, with automatic rollback if cursor commit fails. This is mainly useful when cursors are persisted in the same transactional datasource that the listener is using, for example JdbcCursorManager. Be careful when using this with a ManagedCursorManager, as it is possible that the response from a successful commit gets lost by the network. When the actions of the Listener are now rolled back, those events won't be received again.
    • Method Detail

      • processBatch

        void processBatch​(IORunnable continuation)
                   throws IOException
        Parameters:
        continuation - A closure which will process the current batch when called.
        Throws:
        IOException