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

feat(core.indexing-store): introduce mode param to indexing functions #1295

Closed
wants to merge 1 commit into from

Conversation

tk-o
Copy link

@tk-o tk-o commented Nov 29, 2024

Resolves #1294

This PR allows the indexing function to read the mode of the indexing store.

It's a useful information when sending out notifications to other services (i.e. only sending them out during the realtime indexing phase).

@tk-o tk-o force-pushed the feat/indexing-store-mode-getter branch from 7a0359a to 66499c0 Compare November 29, 2024 11:46
@tk-o tk-o force-pushed the feat/indexing-store-mode-getter branch from 66499c0 to 19db751 Compare November 29, 2024 11:55
@typedarray
Copy link
Collaborator

Hi, thanks for opening. Unfortunately, Ponder does not support running side effects (e.g. notifications) within indexing functions yet. As this comment describes, doing side effects properly is quite difficult.

I fear that if we add & document a "mode" flag, it would an implicit endorsement of side effects. More folks will start using them, and inevitably run into issues because the complexities described above won't be properly handled.

The support burden resulting from these issues will drain maintainer resources that we'd rather spend elsewhere (like to design & build a proper effects feature!).

I fully expect that effects will be a banger feature when we release it. I just want to make sure we do it with intention. If you respond to the issue thread above describing your notifications use case, that would be a huge help - the faster we can gather real requirements, the sooner we'll be able to ship it.

Closing for now - let's move any further discussion to that issue.

@tk-o
Copy link
Author

tk-o commented Dec 2, 2024

I fear that if we add & document a "mode" flag, it would an implicit endorsement of side effects. More folks will start using them, and inevitably run into issues because the complexities described above won't be properly handled.

I will have to find a workaround for my use case. Probably will create a small module that will keep track of the last finalized block and will trigger a fire-and-forget notification for other services in my web stack to react to.

@tk-o
Copy link
Author

tk-o commented Dec 3, 2024

Can we please have a go for this one? It would help me greatly testing my side effects processor implementation that I've discussed in:

Also, it's an opt-in, so not everyone has to use it. But it's very important for testing out a possible solution to handling effects.

Please reconsider merging this one in, @typedarray.

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.

feat: pass the indexing store mode into the indexing function
2 participants