bookkeeper icon indicating copy to clipboard operation
bookkeeper copied to clipboard

Issue #3488 Create an EmbeddedSever extracting code from Main class and adding a builder pattern

Open diegosalvi opened this issue 3 years ago • 3 comments

Descriptions of the changes in this PR:

Motivation

Is enough common for project to start an embedded version of BK using such classes. Instead of rewrite every time boilerplate code the full server instantiation can be extracted from Main class creating a public API to create BookieService from configurations and/or provided component instances.

Changes

I've took code from Main class and refactored into a builder as EmbeddedServer class. Just providing the configuration to the builder produces the same server that Main class was generating. Added multiple builder properties to permit to inject custom implementations for various components. "Injected" component lifecycle is responsability of the implementor (ie.: if you provide specific instances you need to remember to start and/or stop such instances accordingly)

Master Issue: #3488

diegosalvi avatar Sep 14 '22 09:09 diegosalvi

rerun failure checks

StevenLuMT avatar Sep 25 '22 10:09 StevenLuMT

LGTM. There are couple of failing tests on the CI, on the first glance seem to be related to the change. Please take a look.

@diegosalvi have a look at failing tests on the CI

StevenLuMT avatar Sep 28 '22 08:09 StevenLuMT

@diegosalvi PTAL

eolivelli avatar Oct 11 '22 11:10 eolivelli

rerun failure checks

hangc0276 avatar Oct 17 '22 14:10 hangc0276

Finally checks all green

diegosalvi avatar Nov 09 '22 11:11 diegosalvi