Closed simlay closed 3 years ago
@ajhunyady, @sehz this was talked about a little last week. Making the offset
be optional is simple. What the default value should be is unclear - do you want from
to be from the beginning or end of the stream?
@simlay it should be from the end to be consistent with the CLI.
Sounds good.
That being said, we should have 2 convenience offsets, one from the beginning and one from the end. https://github.com/infinyon/fluvio-demo-apps-node/blob/master/chat-app/chat-server/src/fluvio-util.ts I found myself using both.
@simlay, ideally, we should provide all 3 convenience functions/constants to be able to remove this file.
This is how it is implemented in previous version: https://github.com/infinyon/fluvio-client-node/commit/cca8e0fd1a3c57e1a2a3f032209b943d1aa88719#diff-25a6634263c1b1f6fc4697a04e2b9904ea4b042a89af59dc93ec1f5d44848a26.
It accepts following format:
Right now
fetch
requires anOffset
instance, this should be an optional parameter which defaults tonew Offset({index: 0, from: OffsetFrom.Beginning})
when passed into the rust.