@DaveRandom I suspect $process->getPid/Sdtin/out/err() prone to being used too early and sometime exploding under load because called before the Promise resolved
it probably should return some ProcessHandle object within the Promise returned by start() giving direct access to it, without any possible status errors
@DaveRandom right … and I suspect that yield to being easily missed
also in new code
then process ist started, something else is yielded first and usually you can then immediately access the process pid etc.
(because processes are usually launched really fast, faster than most read promises in between or such are resolved)
// i.e. this may work always fine in dev:
$proc = new Process(…);
$proc->start(); // note no yield here…
yield writeProcessStartToRedis();
$stdin = $proc->getStdin();
// ...
Well if the Runner API was changed so that the Process creates the Handle and passes it in, then the PID of the wrapper process and the pipe resources could be made available immediately
actually the actual Resource*Stream objects could be made available immediately as well
but the PID would then change when the real child PID has been retrieved
If you could do that improvement, that'd be awesome :-) I see nothing else to immediately note, will have another look then if you could apply that, thanks a lot!
I added a Database layer in that no framework tutorial. Now I'm trying to handle data on form submit. Do I create a method controller that handles form data validation? Before passing it over to the database layer?
no, just misread it. Anyway, the code should be something like if ( ! $this->FrontFormValidator->nameValidate($data1['name'])) { // return response with a failure
Usually, validators validate a set of fields/values
because sometimes, value validity depends on other submitted information. For example, you can only have 3 out of 4 checked checkboxes, but at least 2 are required
@DaveRandom I'd also like to keep the current API and just have start return a promise, not be a static constructor.
I can work with it being a static constructor returning a promise, just will require more refactoring of parallel then.
Which… I guess isn't a big deal if you actually have processes working on Windows. Looking at parallel I could probably make all the changes in only a couple hours.
The main problem is that constructors use Process::start, so that will require a lot of refactoring to make work. (Actually they're using Context::start, but Process is a one of the contexts.)
@NeelIon you cannot have private chats on Stack Overflow. All channels are public unless a mod turns them into a private channel. And they don't do that for regular users. Only for moderation.
First of all, sorry if this is a duplicate, I've searched and so far I found nothing.
So, when the user goes to "fightzone1.php", it launches a random fight.
$query=$db->prepare('SELECT * FROM monsters ORDER BY RAND() LIMIT 1');
The monster's maximum health is in the database. But, his actual...
@kelunik @Trowski @bwoebi I'm going to leave it as it is for now, changing that API is not a lot of work, can discuss when it's ready to PR (i.e. when I have actually executed a single line of the code I have written...)
It might be possible to have it both ways, since it's possible to call static methods as instance methods without errors
well ... some people say that males have a lot wider bell curve in IQ (as in you get more geniuses and more utter morons) ... this guy must have got the short stick