Skip to content

chore(cache): move cache system out of config#118

Merged
Evalir merged 5 commits into
mainfrom
evalir/move-cache-system
Jun 24, 2025
Merged

chore(cache): move cache system out of config#118
Evalir merged 5 commits into
mainfrom
evalir/move-cache-system

Conversation

@Evalir

@Evalir Evalir commented Jun 23, 2025

Copy link
Copy Markdown
Member

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

Evalir commented Jun 23, 2025

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment thread tests/cache.rs Outdated

let (block_env, _jh) = config.env_task().spawn();
let cache = config.spawn_cache_system(block_env);
let cache = CacheSystem::spawn(&config, block_env);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 prestwich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NACK on the new api. suggested an improvement that's in our idiom.

@Evalir Evalir changed the base branch from evalir/update-rust-version to graphite-base/118 June 23, 2025 15:49
@Evalir Evalir force-pushed the evalir/move-cache-system branch from d06ffc0 to 6575e67 Compare June 23, 2025 15:49
@Evalir Evalir force-pushed the graphite-base/118 branch from e31d791 to b30b12a Compare June 23, 2025 15:49
@graphite-app graphite-app Bot changed the base branch from graphite-base/118 to main June 23, 2025 15:50
@Evalir Evalir force-pushed the evalir/move-cache-system branch from 6575e67 to 7bd7fdd Compare June 23, 2025 15:50

Evalir commented Jun 23, 2025

Copy link
Copy Markdown
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

@prestwich

Copy link
Copy Markdown
Member

it's not new logic, it is a new API

Evalir added 2 commits June 23, 2025 18:52
There's no reason for this to be contained here, and feels wrong when every other task has its own file / spawn pattern.
@Evalir Evalir force-pushed the evalir/move-cache-system branch from 7bd7fdd to f506945 Compare June 23, 2025 16:52
@Evalir Evalir requested a review from prestwich June 23, 2025 17:22
Comment thread bin/builder.rs
Comment thread src/tasks/cache/system.rs Outdated
@Evalir Evalir requested a review from prestwich June 23, 2025 18:38
Comment thread bin/builder.rs Outdated
@Evalir Evalir merged commit 1d10cb6 into main Jun 24, 2025
6 checks passed
@Evalir Evalir deleted the evalir/move-cache-system branch June 24, 2025 10:26
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