Skip to content

feat(feeds): Cache intermediate feeds subscriptions - #711

Merged
dr1rrb merged 3 commits into
mainfrom
dev/dr/reExecIssue
Sep 7, 2022
Merged

dr1rrb merged 3 commits into
mainfrom
dev/dr/reExecIssue

Conversation

@dr1rrb

@dr1rrb dr1rrb commented Sep 6, 2022

Copy link
Copy Markdown
Member

Feature

Cache intermediate feeds subscriptions

What is the current behavior?

We are not caching the subscription to "indermetdiate feeds", e.g.:

private IFeed<int> IntermediateFeed => Feed.Async(async ct => 42);
public IFeed<string> MyFeedA => IntermediateFeed.Select(i => i.ToString());
public IFeed<int> MyFeedB => IntermediateFeed.Where(i => i > 42);

In this example the subscription to the IntermediateFeed is not cached, so if we subscribe to FeedA and FeedB each will make its own subscription, driving the delegate (ct => 42) to be invoked twice.

What is the new behavior?

We are caching subscription to IntermediateFeed on the SourceContext used to subscribe on feeds, and we replay the last message (rebased on initial).

PR Checklist

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template. (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • Associated with an issue (GitHub or internal)

@dr1rrb
dr1rrb enabled auto-merge September 6, 2022 20:32
Co-authored-by: Steve Bilogan <[email protected]>
@dr1rrb
dr1rrb merged commit cd3b88e into main Sep 7, 2022
@dr1rrb
dr1rrb deleted the dev/dr/reExecIssue branch September 7, 2022 15:31
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.

2 participants