Skip to content

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