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

ingest/pipeline: Create functional producer for CaptiveStellarCore LedgerBackend #5451

Open
sreuland opened this issue Sep 3, 2024 · 0 comments

Comments

@sreuland
Copy link
Contributor

sreuland commented Sep 3, 2024

What problem does your feature solve?

captive core ledger backend(CaptiveStellarCore) provides ledger close meta(LCM) individually per GetLedger,but there is no more efficient way to participate as a streaming producer of LCM's..

What would you like to see?

Follow design proposal on Functional Processors Lib
Provide LedgerBackend ‘Producer’ functions for CaptiveCore Backend.
The function will be used as ‘producer’ operator in a pipeline, emitting tx-meta LCM over a callback fn acts as a closure to encapsulate private instance of Captive Core LedgerBackend, avoid any unintended side effects.

// the returned channel will either return one error or it will be closed when the publishing is finished for bounded range
// if it's unbounded, then chan would never be closed.

PublishFromCaptiveCore(ledgerRange ledgerbackend.Range,
                                            captiveCoreConfig ledgerbackend.CaptiveCoreConfig, 
                                            ctx context.Context, 
                                            callback func (xdr.LedgerCloseMeta) error) chan error

The method will return immediate, creating an async worker routine in background to continue processing.

  • it uses whatever prepared ledger range was configured for the backend.
  • it goes into a loop of invoking internal Captive Core LedgerBacked.GetLedger to iterate each LedgerCloseMeta retrieved for the given prepared ledger range.
  • It invokes the callback func per each LedgerCloseMeta.
  • If the range was unbounded then it runs infinite until ctx is canceled.

Visualization of where the producer function fits in the larger CDP design for data transformation pipeline:

dual_func_general

Relates to:

What alternatives are there?

new streaming ingestion app use cases would have to implement the same locally.

@sreuland sreuland changed the title ingest/pipeline: Update CaptiveStellarCore LedgerBackend to support functional pipeline producer ingest/pipeline: Create functional producer for CaptiveStellarCore LedgerBackend Sep 3, 2024
@github-staff github-staff deleted a comment from maher-nakesh Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Do
Development

No branches or pull requests

1 participant