Uploaded image for project: 'Java Couchbase JVM Core'
  1. Java Couchbase JVM Core
  2. JVMCBC-897

Optionally complete IO futures on CoreEnvironment scheduler

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • None
    • 1

    Description

      Currently the IO promises are completed on the netty threads, and as a result all downstream operations are also performed on the netty thread (unless the user manually hops threads with a `publishOn` operator). This is great for performance, but it's a change in behavior from SDK 2, where the promises were completed on the IO thread.

      To help users who want to retain the SDK 2 behavior, or who want to use a different scheduler globally for performance reasons, we can add a flag to the environment, and complete the IO promises using the CoreEnvironment's scheduler instead of the Netty scheduler.

      Michael N notes that for this to work with the Async API, we'll need to do this thread hop close to the metal; we can scheduler a task on the CoreEnvironment's scheduler, and this task can complete the CompletableFuture. The downstream operations will then happen on the CoreEnvironment's scheduler (unless user overrides with a `publishOn` operator).

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              david.nault David Nault
              david.nault David Nault
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty