Execute "initClientContext" asynchronous #47

gemaSantiago opened this Issue Jan 25, 2016 · 0 comments


None yet

2 participants


Currently ClientContextFactory.connect() returns already a CompletableFuture, which is resolved when the ClientContext is ready. During the initialization, we invoke "initClientContext", but we do it synchronously. It can be done asynchronously without changing the public API.

To do this we should create a ClientContextFactory, which has a method createClientContext() that returns a CompletableFuture. The creation of ClientContextImpl has to be separated into two parts. Invoking "initClientContext" has to be pulled out of the constructor and done separately in the factory method. The factory method resolves the CompletableFuture once the invokation of "initClientContext" returns.

ClientContextFactory finishes the initialization after the CompletableFuture from ClientContextFactory is completed and resolves its own CompletableFuture once everything is done.

@hendrikebbers hendrikebbers added this to the 0.8.6 milestone Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment