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

Add MessageDb feed source #181

Merged
merged 44 commits into from Nov 18, 2022
Merged

Add MessageDb feed source #181

merged 44 commits into from Nov 18, 2022

Conversation

nordfjord
Copy link
Contributor

@nordfjord nordfjord commented Nov 12, 2022

No description provided.

@nordfjord nordfjord marked this pull request as ready for review November 12, 2022 14:27
CHANGELOG.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@bartelink
Copy link
Collaborator

Might as well also wire this into propulsion checkpoint (see tools/propulsion.tool/program.fs)

@bartelink
Copy link
Collaborator

FYI I implemented an "all caught up" check in

member x.RunUntilCaughtUp(timeout : TimeSpan, statsInterval : IntervalTimer) = task {

which is used in Lambda reactors e.g. https://github.com/jet/dotnet-templates/blob/e063a661de8154336d29eba090e62157ed6dbe6d/equinox-shipping/Watchdog.Lambda/Function.fs#L97

This could probably be generalized somewhat (it's messy to do for Cosmos, but that impl would work for esdb, sss and also mdb)

For mdb, you might be able to do a slightly more optimized thing (though the monitor here has all the context to know the instant all feed positions have caught the tail, regardless of where those checkpoints live and/or whether they've actually been committed yet)

Probably the best resolution is to do a PR to move it somewhere more general if you ever end up needing it

@nordfjord
Copy link
Contributor Author

nordfjord commented Nov 15, 2022

FYI I implemented an "all caught up" check in

Interesting! I would love to learn more about this. I hadn't considered an "all caught up" check to be possible with an ever growing sequence of events 🤔.

Looking at the code it seems to use the isTail value of the batch which I naively set to false as a constant. I've fixed that now so we assume it's the tail when we reach an empty page

What's the context you're using this in?

Based on the comments I'm gathering that you have a processor running in lambda, and you run this lambda every minute via cron. I'm guessing this is a cost optimization strategy for you since after catching up you'd be billed for the lambda essentially doing nothing? So I guess it's in a context where

  1. you can afford up to a minute of delay in reactions
  2. idling costs are significant

@bartelink
Copy link
Collaborator

Lovely work, thanks!

@bartelink bartelink merged commit a689ef3 into jet:master Nov 18, 2022
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.

None yet

2 participants