Skip to content

Use threads instead of forking to compile slices assets#404

Open
katafrakt wants to merge 1 commit intomainfrom
replace-fork
Open

Use threads instead of forking to compile slices assets#404
katafrakt wants to merge 1 commit intomainfrom
replace-fork

Conversation

@katafrakt
Copy link
Copy Markdown
Contributor

One of the main blockers for JRuby adoption in Hanami is that Hanami CLI uses fork to spawn assets compilation for slices in parallel. I was trying to find a reason why it was done like that for a while, but could not find any. I also recently found hanami/hanami#1524 (comment) which asks about the same and no conclusion was made.

This PR replaces Process.fork with Thread.new. In my tests everything still works and assets are being compiled in parallel.

I haven't found any compelling reason to prefer `fork` here over threads
and this enables assets compilation on JRuby.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

ℹ️ Optional job failed: Ruby jruby

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.

1 participant