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

revamp #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

revamp #37

wants to merge 3 commits into from

Conversation

ssscrom
Copy link
Contributor

@ssscrom ssscrom commented Apr 17, 2023

This revamp focuses on the workflow of bridgre core. For example, the processBatchLogs flow orderly goes as below:

  • controller fetch logs from node
  • for each log, create a perspective job then push these jobs into pool
  • pool orchestrate jobs to workers
  • worker triggers the process behind the job and does further process
  • job contacts directly to listener

This flow shows no signature in each component. In fact, they are multiple layers sharing the same responsibility so features can be placed anywhere instead of in a specific layer.

The revamp rearranges the flow

  • controller fetch logs from node
  • for each log, create a perspective job then push these jobs into orchestrator
  • orchestrator gets worker from pool then assigns job for worker
  • worker contacts directly to listener and call the perspective callback based on job's information

The new flow split pool into two components: orchestrator and pool. job no longer does any logic, they convey data instead.

Afterward, the flow is composed from these components:

  • controller: fetch logs then feed jobs
  • orchestrator: deliver job to proper worker from pool
  • pool: collection of items prepared to use later
  • worker: set of logic to process job
  • job: set of data required for a request

@ssscrom ssscrom changed the title Revamping new flow revamp May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants