chore(cache): move cache system out of config#118
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
prestwich
reviewed
Jun 23, 2025
|
|
||
| let (block_env, _jh) = config.env_task().spawn(); | ||
| let cache = config.spawn_cache_system(block_env); | ||
| let cache = CacheSystem::spawn(&config, block_env); |
Member
There was a problem hiding this comment.
this API doesn't match our idiom. our idiom is to
- instantiate a struct
let my_struct = MyStruct::new(...) - call
my_struct.spawn()
CacheSystem is not a spawnable task in this way, it;s only a holder for the join handles and a ref to the simcache to ensure it is not prematurely dropped
if you want to make a spawnable CacheTasks then it should be a composition of the 2 component tasks that spawns both of them
struct CacheTask {
/// The transaction poller task.
pub tx: TxPoller,
/// The bundle poller task.
pub bundle: BundlePoller
}
prestwich
requested changes
Jun 23, 2025
prestwich
left a comment
Member
There was a problem hiding this comment.
NACK on the new api. suggested an improvement that's in our idiom.
d06ffc0 to
6575e67
Compare
e31d791 to
b30b12a
Compare
6575e67 to
7bd7fdd
Compare
Member
Author
|
Note that this is not a new api—this was just moved from the config file. I'll update to the newly proposed API |
Member
|
it's not new logic, it is a new API |
There's no reason for this to be contained here, and feels wrong when every other task has its own file / spawn pattern.
7bd7fdd to
f506945
Compare
prestwich
reviewed
Jun 23, 2025
prestwich
reviewed
Jun 23, 2025
prestwich
reviewed
Jun 23, 2025
prestwich
approved these changes
Jun 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

There's no reason for this to be contained here, and feels wrong when every other task has its own file / spawn pattern.