{"id":24379820,"url":"https://github.com/sake92/mill-client-server-poc","last_synced_at":"2026-02-28T04:34:45.897Z","repository":{"id":270477442,"uuid":"909292409","full_name":"sake92/mill-client-server-poc","owner":"sake92","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-06T08:01:41.000Z","size":49,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T21:36:42.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sake92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-28T09:07:29.000Z","updated_at":"2025-01-06T08:01:45.000Z","dependencies_parsed_at":"2025-04-10T21:40:37.835Z","dependency_job_id":null,"html_url":"https://github.com/sake92/mill-client-server-poc","commit_stats":null,"previous_names":["sake92/mill-client-server-poc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sake92/mill-client-server-poc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fmill-client-server-poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fmill-client-server-poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fmill-client-server-poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fmill-client-server-poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sake92","download_url":"https://codeload.github.com/sake92/mill-client-server-poc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fmill-client-server-poc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29924750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-19T07:27:46.877Z","updated_at":"2026-02-28T04:34:45.868Z","avatar_url":"https://github.com/sake92.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mill-client-server-poc\n\nProof of Concept goals:\n- one server per workspace/project\n- multiple simultaneous clients\n- 2-way client-server protocol, in messagepack lightweight format\n- per-task in-memory locking (since there is 1 singleton server)\n- subprocesseses are run by client to have terminal available, but still using server speed to compile etc.\n- watch mode with a subprocess works nicely\n\nComparison of how JVM build tool daemons handle interactive processes:  \nhttps://github.com/sake92/java-build-tool-daemon-interactive  \nSpolier: poorly\n\nTODOs:\n- reload server config automatically when its config file changes\n- restart server automatically when its JVM config file changes\n- handle server/client disconnects gracefully\n\n## Server \n\n```sh\n./mill server.assembly\njava -jar ./out/server/assembly.dest/out.jar\n```\n\n## Client\n\nBoth JVM and ScalaNative work.\n\n### JVM\n```sh\n./mill client.jvm.assembly\njava -jar ./out/client/jvm/assembly.dest/out.jar -c noop\n```\n\n### ScalaNative\n```sh\n./mill show client.native.nativeLink\n./out/client/native/nativeLink.dest/out.exe -c noop\n```\n\n---\n## Behavior\n\n---\n### Automatic server start\nIt will start the server *if needed* (if it can't connect).  \nNote that it is not launching the server as a detached/daemon process yet..\n```\njava -jar ./out/client/jvm/assembly.dest/out.jar -c task\nCould not connect to server. Starting a new one...\n........\n```\n\n---\n### Task-level locking\nIf 2 clients run the same task, it will be done with an in-memory lock being held.  \nThis is output from the client2 (while client1 was already running the task):\n```sh\n\u003e java -jar ./out/client/jvm/assembly.dest/out.jar -c task1\n[server] Task lock busy, waiting for it to be released...\n[server] Task lock busy, waiting for it to be released...\n[server] Task lock busy, waiting for it to be released...\n[server] Working on task 'task1' ...\n```\n\n\n---\nThere are a few commands implemented:\n- `version`, prints the version (no server interaction at all)\n- `noop`, does nothing on server, just sends back a \"done\" command\n- `subprocess`, tells the client to run a subprocess (not interactive)\n- `interactiveSubprocess`, tells the client to run a subprocess (interactive, requires input from user)\n- `-w interactiveSubprocess`, tells the client to run an interactive subprocess in watch mode, watching \"example_project\" files\n- `task1`, runs a slow task, so you can test the task-level locking behavior\n- `task2`, same as `task1`, but using a different lock, so they can run independently\n- `shutdown`, stops the server\n\n----\n\n### Measuring JVM vs ScalaNative\n\n```sh\n# JVM\nPS D:\\projects\\sake\\mill-client-server-poc\u003e hyperfine \"java -jar out\\client\\jvm\\assembly.dest\\out.jar -c noop\"\nBenchmark 1: java -jar out\\client\\jvm\\assembly.dest\\out.jar -c noop\n  Time (mean ± σ):     323.0 ms ±  10.8 ms    [User: 47.8 ms, System: 11.9 ms]\n  Range (min … max):   305.7 ms … 346.4 ms    10 runs\n  \n# vs native\nPS D:\\projects\\sake\\mill-client-server-poc\u003e hyperfine \"out\\client\\native\\nativeLink.dest\\out.exe -c noop\"\nBenchmark 1: out\\client\\native\\nativeLink.dest\\out.exe -c noop\n  Time (mean ± σ):      37.8 ms ±   5.5 ms    [User: 1.9 ms, System: 1.8 ms]\n  Range (min … max):    27.1 ms …  53.4 ms    59 runs\n```\n\nNote these are ran on Windows, you can see the GitHub Actions logs for Linux version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsake92%2Fmill-client-server-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsake92%2Fmill-client-server-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsake92%2Fmill-client-server-poc/lists"}