Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize scalecube - serverLifePeriodMS option #200

Open
3 of 10 tasks
katzIdo opened this issue Oct 23, 2019 · 0 comments
Open
3 of 10 tasks

optimize scalecube - serverLifePeriodMS option #200

katzIdo opened this issue Oct 23, 2019 · 0 comments

Comments

@katzIdo
Copy link
Collaborator

katzIdo commented Oct 23, 2019

General description

every microservice container can act as a seed for another microservice container in our distributed env.

it results in inflation of unnecessary listeners which are added to the project.

every microservice that acts as a seed creates a "server-side" logic which means using a global listener that checks if it's been called.

my suggestion is to add to microservice API another property which called "serverLifePeriodMS: number"

if (serverLifePeriodMS === undefined) {
  // server listener will live forever
} else {
  // server will stop listen after  serverLifePeriodMS is done
}

this option is good when we creating an empty microservice that is used only to get proxies of other microservice containers, we can pass serverLifePeriodMS = 0.

or if we are running on the browser and we know that our services will load after x period of time, then we can set our serverLifePeriodMS to be 2*x.

this option is valid for the browser because it is unusual for service to be "destroyed" in the browser.

this is another reason why cluster-browser does not implement a "keep-alive" check.

API

Design proposition

A clear and concise description of the design proposition.

  • Is backward compatible

  • Adds new API

Pull Request

[Link]

New API

Code snippet

export interface MicroserviceOptions {
  // ... all previus methods unchanged
 serverLifePeriodMS : number
}

Ready for implementation

  • External dependencies have been resolved

  • API has been approved

  • Test cases have been prepared

  • Discussed with Technical lead

Definition of Done

  • Developer review

  • QA review

  • All tests are implemented

  • Documentation

@katzIdo katzIdo added this to backlog in Version 0.2.x Oct 23, 2019
@katzIdo katzIdo changed the title optimize scalecube - isSeedOption optimize scalecube - requireServer option Oct 24, 2019
@katzIdo katzIdo moved this from backlog to todo in Version 0.2.x Oct 24, 2019
@katzIdo katzIdo changed the title optimize scalecube - requireServer option optimize scalecube - serverLifePeriodMS option Nov 13, 2019
@katzIdo katzIdo moved this from todo to backlog in Version 0.2.x Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Version 0.2.x
  
backlog
Development

No branches or pull requests

1 participant