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

[feat] /health implementation #35

Closed
5 tasks done
lgrd opened this issue Jan 30, 2023 · 0 comments · Fixed by #39
Closed
5 tasks done

[feat] /health implementation #35

lgrd opened this issue Jan 30, 2023 · 0 comments · Fixed by #39
Assignees
Labels
enhancement New feature or request

Comments

@lgrd
Copy link
Collaborator

lgrd commented Jan 30, 2023

A /heath route exists but it is a fake one in the sense you just know that the service is alive. Create a more sophisticated one :

  • Be sure of the io. See [doc] Update administration API specification #34
  • Choose the protocol of communication between an administrator and its services: direct (sameProcess) or IPC (newProcess)
  • Code it (see next paragrah)
  • Update doc (ex. functionalities)
  • Update tests

Code

  • Create requests/healthRequest.js which is the request part of the interface
  • Create responses/healthResponse.js which is the response part of the interface
  • Update apis/admin/1.0.0/index.js to handle the request and its parameters. This is where an interface is created (see simple/1.0.0). The interface is send to the administrator. The answer will be generated from the interface received in response to the request interface.
  • Update administrator/administrator.js to handle the interface. It will only send it to the serviceManager and wait for the answer
  • Update service/serviceManager.js to handle the interface. It will send the interface to each administered service (call to administeredService.computeRequest(request)) and wait for the answers.
  • Update each administered service to handle the interface (code computeRequest(request) for each one)
    • sameProcess : call to service.computeAdminRequest(request)
    • newProcess : send a message to the child process
  • Update service/service.js to handle the interface for each protocol. It reads the request interface and answers the response interface.
    • code service.computeAdminRequest()
    • find a place to code message reception and call to service.computeAdminRequest()
    • code service.health() to call its source.health()
  • Update each source to code source.health()
@lgrd lgrd added the enhancement New feature or request label Jan 30, 2023
@lgrd lgrd self-assigned this Jan 30, 2023
@lgrd lgrd linked a pull request Feb 17, 2023 that will close this issue
@lgrd lgrd closed this as completed in #39 Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant