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

auto-prune in-memory stream data #1095

Closed
2 tasks done
DaveSkender opened this issue Oct 12, 2023 · 7 comments · Fixed by #1290
Closed
2 tasks done

auto-prune in-memory stream data #1095

DaveSkender opened this issue Oct 12, 2023 · 7 comments · Fixed by #1290
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@DaveSkender
Copy link
Owner

DaveSkender commented Oct 12, 2023

Hi, I'm right now trying out v3.0.0 preview and wanted to ask whether there is or will be an option to limit the size of the data collections held by both, observable and observer, as I didn't find any yet. Thanks!

Originally posted by @elpht in #1018 (comment)

The idea of these collections growing in an uncontrolled manner has crossed my mind. Since these are instantiated classes, I think we can add an optional setting so you can supply a max size that'll trigger some auto-pruning after new data arrives. Makes sense.

Objective:

  • add standard optional settings schema with defaults
  • setting for max collection size, with auto-pruning (default: off)

See also:

@DaveSkender DaveSkender added this to the v3 milestone Oct 12, 2023
@DaveSkender DaveSkender added the enhancement New feature or request label Oct 12, 2023
@DaveSkender DaveSkender moved this from Maybe to Do Next in Stock Indicators for .NET Oct 12, 2023
@elpht

This comment was marked as outdated.

@DaveSkender

This comment was marked as outdated.

@elpht

This comment was marked as resolved.

@DaveSkender

This comment was marked as resolved.

@DaveSkender

This comment was marked as resolved.

@DaveSkender
Copy link
Owner Author

DaveSkender commented Dec 16, 2024

This was implemented for v3.

Instead of an unlimited cache size option, I based the default on 90% of the int size, which is effectively the same thing but does cap it to avoid running out of the List native size.

Since everything is derived from a QuoteHub ultimately, maxCacheSize is set on its instantiation and subscribers (observers) simply inherit it. There is a backdoor way to instantiate a non-Quote hub, but it's unadvisable for most users as it's difficult to use that way.

@github-project-automation github-project-automation bot moved this from In Review to Done in Stock Indicators for .NET Dec 16, 2024
@DaveSkender
Copy link
Owner Author

This is available in 3.0.0-preview.1

@DaveSkender DaveSkender self-assigned this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants