Giter Club home page Giter Club logo

Comments (8)

theofidry avatar theofidry commented on May 26, 2024 1

Yes

from console-parallelization.

theofidry avatar theofidry commented on May 26, 2024

You could alter the code to ensure a child process is used even for --processes 1 (currently if only 1 thread is found, it will use the current process instead of spawning a child one)

But IIRC, there is the run{Before,After}Batch() which can help to clean some state (e.g. clearing the repositories)

from console-parallelization.

christian-kolb avatar christian-kolb commented on May 26, 2024

@theofidry Thanks for the fast reply 🙂
Using the run{Before,After}Batch() methods is unfortunately not an option. I'm using the command to run a replay of projections in an EventSourcing system and on execution time don't know which repositories are used within the projection handlers. That's why I thought of the child processes as this would automatically clear all used resources.

With altering the code you mean overwriting executeMasterProcess, copying everything over and adapt to always use the child process method? That would have been my backup plan 🙂 But if there is no other way, that I will need to do this. Do you think this would make a useful feature for this package? Something like an optional --always-use-child-process argument to trigger this behaviour?

from console-parallelization.

theofidry avatar theofidry commented on May 26, 2024

I was more thinking of a PR to change the behaviour to use a child process when giving --processes 1. That would be simpler and more consistent than introducing a new option just for this case

from console-parallelization.

christian-kolb avatar christian-kolb commented on May 26, 2024

@theofidry Ah ok, doesn't that change the current behaviour? If someone is using --processes 1 it it's the same as not setting it. With an update the behaviour would change. I don't know if there is a relevant usage set of users which this configuration.

But I wouldn't mind. If it's ok to you, I would prepare a pull request tomorrow.

from console-parallelization.

theofidry avatar theofidry commented on May 26, 2024

Technically it is a BC, but since it's quite an edge and arguably a bug (you do specify a process: why doesn't it spawn a child?) I think it could pass in 1.1.0

from console-parallelization.

christian-kolb avatar christian-kolb commented on May 26, 2024

Great, then I will try to provide a pull request tomorrow. Is it enough to provide an additional test like test_it_can_run_the_command_with_multiple_processes?

from console-parallelization.

theofidry avatar theofidry commented on May 26, 2024

Closed by #15

from console-parallelization.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.