-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
exp/ingest: Ingest pipeline prototype (#1264)
- Loading branch information
Showing
20 changed files
with
1,387 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/stellar/go/xdr" | ||
) | ||
|
||
var EOF = io.EOF | ||
var ErrClosedPipe = io.ErrClosedPipe | ||
|
||
// StateReadCloser interface placeholder | ||
type StateReadCloser interface { | ||
GetSequence() uint32 | ||
// Read should return next ledger entry. If there are no more | ||
// entries it should return `EOF` error. | ||
Read() (xdr.LedgerEntry, error) | ||
// Close should be called when reading is finished. This is especially | ||
// helpful when there are still some entries available so reader can stop | ||
// streaming them. | ||
Close() error | ||
} | ||
|
||
// StateWriteCloser interface placeholder | ||
type StateWriteCloser interface { | ||
// Write is used to pass ledger entry to the next processor. It can return | ||
// `ErrClosedPipe` when the pipe between processors has been closed meaning | ||
// that next processor does not need more data. In such situation the current | ||
// processor can terminate as sending more entries to a `StateWriteCloser` | ||
// does not make sense (will not be read). | ||
Write(xdr.LedgerEntry) error | ||
// Close should be called when there are no more entries | ||
// to write. | ||
Close() error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.