Giter Site home page Giter Site logo

Comments (9)

lifo101 avatar lifo101 commented on June 26, 2024

I'm not familiar with how pcntl_exec works. Have you tried to use it within your daemon yet? If you call that method while in a worker process, it might not cause any issues. But, since pcntl_exec "replaces" the current process with the sub process, I'm not sure what side effects that will have on the worker process, it may break it's communication with the parent daemon process.

from php-daemon.

lifo101 avatar lifo101 commented on June 26, 2024

I will also add, that if you're just triggering a worker to 'fire and forget' the process, then you should be able to maybe safely use a Task, since those don't communicate to the daemon parent.

from php-daemon.

quazardous avatar quazardous commented on June 26, 2024

and is it possible to retrieve Task exit code ?

from php-daemon.

quazardous avatar quazardous commented on June 26, 2024

Have you tried to use it within your daemon yet

I've a somewhat handmade daemon using fork and pcntl_exec() but not with your Daemon yet

from php-daemon.

lifo101 avatar lifo101 commented on June 26, 2024

If you use a Worker, then you can return the exit code, but not from a Task.

from php-daemon.

quazardous avatar quazardous commented on June 26, 2024

crap I'm stuck ...
could exit code for Task be something you'll consider usefull ?

from php-daemon.

lifo101 avatar lifo101 commented on June 26, 2024

That is why there are Workers.

from php-daemon.

quazardous avatar quazardous commented on June 26, 2024

I mean the low level pcntl_wexitstatus

could be an event

from php-daemon.

lifo101 avatar lifo101 commented on June 26, 2024

The Daemon::task method returns a Process object that represents the sub process that was started. Using that object you can interact with the process. ie: get it's PID, etc. Using that you might be able to do more of what you want to do.

from php-daemon.

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.