{"id":20905953,"url":"https://github.com/objectprofile/dmirror","last_synced_at":"2025-12-28T22:30:28.848Z","repository":{"id":78478106,"uuid":"172970669","full_name":"ObjectProfile/DMirror","owner":"ObjectProfile","description":"Tool to spawn new job on forked Pharo images","archived":false,"fork":false,"pushed_at":"2024-02-01T15:53:54.000Z","size":28,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-19T14:22:01.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Smalltalk","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/ObjectProfile.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}},"created_at":"2019-02-27T18:48:03.000Z","updated_at":"2024-02-01T15:53:31.000Z","dependencies_parsed_at":"2024-11-11T13:01:30.257Z","dependency_job_id":null,"html_url":"https://github.com/ObjectProfile/DMirror","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObjectProfile%2FDMirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObjectProfile%2FDMirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObjectProfile%2FDMirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObjectProfile%2FDMirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ObjectProfile","download_url":"https://codeload.github.com/ObjectProfile/DMirror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243297265,"owners_count":20268744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-18T13:28:20.001Z","updated_at":"2025-12-28T22:30:28.800Z","avatar_url":"https://github.com/ObjectProfile.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DMirror\nTool to spawn new job on forked Pharo images. This library allow you to split a workload in several workers consisting on copies of the current Pharo image executed by several Pharo vms.\n\n## How to install\n\nExecute the following code snippet to load DMirror in a fresh Pharo 7 image:\n\n```\nMetacello new\n    baseline: 'DMirror';\n    repository: 'github://ObjectProfile/DMirror/src';\n    load.\n```\n\n## Example\n\nThe following code snippet allow you to split the execution of a `collect:` message in several workers. The library assumes that the code inside the block does not perform side-effects, in case it does, the behavior is not specified.\n\n```Smalltalk\n(1 to: 1000) parallelCollect: [ :i | i * 10 ].\n```\n\nYou can use the method `DMirror class\u003e\u003edefaultCores:` to set the number of workers you wish to have.\n\n## Arbitrary worker execution\n\nDMirror allow users to execute arbitrary pieces of code in different workers. The workers have access to the whole system, all the libraries available in the current image and their globals. Nevertheless, the user may use them as read-only values, because the library behavior is not defined in case of side-effects performed by the user code execution.\n\nThe following snippet allow a user to define an arbitrary code to be parallelized in several mirrors or workers. The concrete action of the workers is to remove the spaces in the strings.\n\n```Smalltalk\n(DMirror \n\tcreateMirror: [ :obj :id | obj reject: [ :char | char = Character space ] ]\n\tworkloadArray: #('foo bar zork' '1 2 3 4 5')) run.\n```\n\nThe mirror will spawn a new vm process for each element in the workloadArray, therefore, if the user pass an array with 20 elements, the library will spawn 20 processes. Each process will apply the block to one of the elements of the workloadArray, being it the first argument. The second argument of the block is opcional and corresponds to the position of the element in the workloadArray.\n\n## Collection API\n\nDMirror implements several of the Collection API including: \n\n- `collect:` -\u003e `parallelCollect:`\n- `collect:thenReject:` -\u003e `parallelCollect:thenReject:`\n- `collect:thenSelect:` -\u003e `parallelCollect:thenSelect:`\n- `select:` -\u003e `parallelSelect:`\n- `select:thenCollect:` -\u003e `parallelSelect:thenCollect:`\n- `reject:` -\u003e `parallelReject:`\n- `reject:thenCollect:` -\u003e `parallelReject:thenCollect:`\n- `flatCollect:` -\u003e `parallelFlatCollect:`\n- `groupedBy:` -\u003e `parallelGroupedBy:`\n- `anySatisfy:` -\u003e `parallelAnySatisfy:`\n- `allSatisfy:` -\u003e `parallelAllSatisfy:`\n- `noneSatisfy:` -\u003e `parallelNoneSatisfy:`\n\n## Error debugging\n\nIn case of errors in the worker execution the library will signal an Error and open a debugger showing the state of all the workers that failed. Those debuggers allow you to inspect the execution, but you will not be able to continue the execution or restart it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectprofile%2Fdmirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobjectprofile%2Fdmirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectprofile%2Fdmirror/lists"}