<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Cees-Jan Kiewiet's blog - Latest Comments</title><link>http://ramblingsofadeveloper.disqus.com/</link><description>On Development and Information Systems</description><atom:link href="https://ramblingsofadeveloper.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 06 Apr 2020 11:45:54 -0000</lastBuildDate><item><title>Re: ReactPHP: Sockets — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/03/reactphp-sockets#comment-4863330222</link><description>&lt;p&gt;How send message to all connection users?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Igor  Bezlepkin</dc:creator><pubDate>Mon, 06 Apr 2020 11:45:54 -0000</pubDate></item><item><title>Re: ReactPHP: Filesystem — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/03/reactphp-filesystem#comment-4629227371</link><description>&lt;p&gt;Doing another reply to myself... While the echo after the foreach loops triggers first, code inside the loop is blocking and spitting the "Dumping.." message one after the other. Although the order changes every time, I was expecting to get maybe concurrency while processing the XML files and get some echoes concurrently. Can't figure this out. Do I have to "promisify" the external library I use (SabreXML)?? Documentation is not very helpful when you need to convert your code to sync (or some other lib)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">LaracastsLuvr</dc:creator><pubDate>Wed, 25 Sep 2019 17:58:04 -0000</pubDate></item><item><title>Re: ReactPHP: Filesystem — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/03/reactphp-filesystem#comment-4629118598</link><description>&lt;p&gt;Replying to my self, I did a quick echo immediately after the foreach block,&lt;br&gt;&lt;code&gt;&lt;br&gt;echo 'After foreach', PHP_EOL;&lt;br&gt;&lt;/code&gt;&lt;br&gt;It echoes the string then start echoing the messages from the loop&lt;br&gt;And I guess the the processing of the XML files is happening asynchronously.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">LaracastsLuvr</dc:creator><pubDate>Wed, 25 Sep 2019 16:33:00 -0000</pubDate></item><item><title>Re: ReactPHP: Filesystem — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/03/reactphp-filesystem#comment-4629111958</link><description>&lt;p&gt;Without ext-eio I noticed a huge delay in wait time until I see some activity in my script.&lt;/p&gt;&lt;p&gt;Here is the test script.&lt;br&gt;&lt;code&gt;&lt;br&gt;$loop = \React\EventLoop\Factory::create();&lt;br&gt;$filesystem = \React\Filesystem\Filesystem::create($loop);&lt;br&gt;&lt;br&gt;$file_targets = ['file1.xml', 'file2.xml', 'fileN.xml', 'file40.xml]; // contains 40 local files, 3MB each&lt;br&gt;&lt;br&gt;foreach($file_targets as $target)&lt;br&gt;{&lt;br&gt;    $filesystem-&amp;gt;getContents($target)-&amp;gt;then(function($contents) use ($target) {&lt;br&gt;        // Some $target processing with SabreXML service&lt;br&gt;        echo "Dumping {$target} content counts", PHP_EOL;&lt;br&gt;    });&lt;br&gt;}&lt;br&gt;&lt;br&gt;$i = 0;&lt;br&gt;$loop-&amp;gt;addPeriodicTimer(1, function(\React\EventLoop\Timer\Timer $timer) use (&amp;amp;$i, $loop) {&lt;br&gt;    echo ++$i, PHP_EOL;&lt;br&gt;    if($i &amp;gt;= 30)&lt;br&gt;    {&lt;br&gt;        $loop-&amp;gt;cancelTimer($timer);&lt;br&gt;    }&lt;br&gt;});&lt;br&gt;$loop-&amp;gt;run();&lt;br&gt;&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;I added the periodic timer function to have an indication.&lt;br&gt;It counts up to 16 ticks, then I see the echo message. This without ext-eio installed. On the other hand, with ext-eio installed and loaded, I get the response immediately and the ticks start after that at 1, 2, ... etc.. Don't know if I'm blocking the loop with that Foreach tho..&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">LaracastsLuvr</dc:creator><pubDate>Wed, 25 Sep 2019 16:28:01 -0000</pubDate></item><item><title>Re: ReactPHP: Child Processes — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/03/reactphp-child-processes#comment-4629062117</link><description>&lt;p&gt;They're not, planning to update them the next two weeks when I have some days off. And add a warning at the top for which version this is. In that example use the $loop variable like you're pulling in the $process one and replace the $timer-&amp;gt;getLoop() call with it.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">WyriHaximus</dc:creator><pubDate>Wed, 25 Sep 2019 15:51:18 -0000</pubDate></item><item><title>Re: ReactPHP: Filesystem — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/03/reactphp-filesystem#comment-4629059155</link><description>&lt;p&gt;ext-eio is optional, if it isn't present the package will switch to a child process adapter. Also be sure to restart your process when adding/removing extensions from your environment.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">WyriHaximus</dc:creator><pubDate>Wed, 25 Sep 2019 15:49:14 -0000</pubDate></item><item><title>Re: ReactPHP: Child Processes — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/03/reactphp-child-processes#comment-4628730519</link><description>&lt;p&gt;Can you verify that the first example is correct and still working today?&lt;/p&gt;&lt;p&gt;Because I get the following:&lt;br&gt;&lt;code&gt;&lt;br&gt;PHP Fatal error:  Uncaught Error: Call to undefined method React\EventLoop\Timer\Timer::getLoop() in /var/www/html/uptime.php&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;br&gt;&lt;br&gt;require __DIR__ . '/vendor/autoload.php';&lt;br&gt;&lt;br&gt;$loop = \React\EventLoop\Factory::create();&lt;br&gt;$process = new \React\ChildProcess\Process('uptime');&lt;br&gt;&lt;br&gt;$loop-&amp;gt;addTimer(0.001, function($timer) use ($process) {&lt;br&gt;    $process-&amp;gt;start($timer-&amp;gt;getLoop()); // works if I replace $timer-&amp;gt;getLoop() with $loop included in the inheritance of the Closure&lt;br&gt;&lt;br&gt;    $process-&amp;gt;stdout-&amp;gt;on('data', function($output) {&lt;br&gt;        echo $output;&lt;br&gt;    });&lt;br&gt;});&lt;br&gt;&lt;br&gt;$loop-&amp;gt;run();&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Is this the correct way to pull in $loop in the Closure and replace the $timer-&amp;gt;getLoop() with $loop or did I mess it somehow?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">LaracastsLuvr</dc:creator><pubDate>Wed, 25 Sep 2019 11:58:44 -0000</pubDate></item><item><title>Re: ReactPHP: Filesystem — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/03/reactphp-filesystem#comment-4627160882</link><description>&lt;p&gt;Is ext-eio required or optional ? For someone that can't install it for example..&lt;br&gt;Because I installed the pecl, then removed it and did not see any difference. Since PHP Cli doesn't need to be restarted, I assume it was loaded then un-loaded. But the Filesystem works.. I mean I can write to files downloaded stuff (10x remote xml files 3MB each get written to disk)&lt;br&gt;&lt;code&gt;&lt;br&gt;&lt;br&gt;use Clue\React\Buzz\Browser;&lt;br&gt;use React\EventLoop\Factory;&lt;br&gt;use React\Filesystem\Filesystem;&lt;br&gt;&lt;br&gt;require __DIR__ . '/vendor/autoload.php';&lt;br&gt;&lt;br&gt;$loop = Factory::create();&lt;br&gt;$filesystem = Filesystem::create($loop);&lt;br&gt;$client = new Browser($loop);&lt;br&gt;$streamingBrowser = $client-&amp;gt;withOptions(['streaming' =&amp;gt; true]);&lt;br&gt;&lt;br&gt;$urls = [&lt;br&gt;    ['store' =&amp;gt; 'some-name', 'xml' =&amp;gt; "some-remate-xml-file.xmll"],&lt;br&gt;];&lt;br&gt;&lt;br&gt;foreach($urls as $url)&lt;br&gt;{&lt;br&gt;    $file = $filesystem-&amp;gt;file(__DIR__ . DIRECTORY_SEPARATOR . 'downloads' . DIRECTORY_SEPARATOR . $url['store'].'.xml');&lt;br&gt;    $stream = \React\Promise\Stream\unwrapWritable($file-&amp;gt;open('cwt'));&lt;br&gt;&lt;br&gt;    $streamingBrowser&lt;br&gt;        -&amp;gt;get($url['xml'])&lt;br&gt;        -&amp;gt;then(function (\Psr\Http\Message\ResponseInterface $response) use ($stream) {&lt;br&gt;            $response-&amp;gt;getBody()-&amp;gt;pipe($stream);&lt;br&gt;        });&lt;br&gt;}&lt;br&gt;&lt;br&gt;$loop-&amp;gt;run();&lt;br&gt;&lt;br&gt;&lt;/code&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">LaracastsLuvr</dc:creator><pubDate>Tue, 24 Sep 2019 09:46:52 -0000</pubDate></item><item><title>Re: Running php unit tests on Windows using AppVeyor and Chocolatey — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2016/11/running-php-unit-tests-on-windows-using-appveyor-and-chocolatey#comment-4562555084</link><description>&lt;p&gt;Yesterday, AppVeyor was providing various PHP versions for testing. Today, PHP 7.3.7 is the only version available. To make it more visible when AppVeyor again changes the set of available versions, I added a snippet from the script above to show everything that is available.&lt;/p&gt;&lt;p&gt;  - choco search php --exact --all-versions -r&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Greg Anderson</dc:creator><pubDate>Thu, 01 Aug 2019 19:41:50 -0000</pubDate></item><item><title>Re: ReactPHP: Timers — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/01/reactphp-timers#comment-4342345062</link><description>&lt;p&gt;Sorry, I thought I deleted that comment, it was actually a case of PICNIC from being in a rush and getting an error message that first looked like the interface had changed :D.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">First</dc:creator><pubDate>Sun, 17 Feb 2019 18:38:38 -0000</pubDate></item><item><title>Re: Test lowest, current, and highest possible on Travis — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/06/test-lowest-current-and-highest-possible-on-travis#comment-4342187704</link><description>&lt;p&gt;4 years after writing this my main issue with this set up are the unrelated failures due to language changes, odd dependency mix ups. So I'm keeping the same set up but only support currently supported PHP versions keeping to about 9 builds for most projects. Now I'm also dropping highest in the near future in favour of Dependanbot taking care of then when a new version of a dependency is out. This way we're back to 6 jobs. Your tool looks interesting, I'll have a look at it&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">WyriHaximus</dc:creator><pubDate>Sun, 17 Feb 2019 16:09:33 -0000</pubDate></item><item><title>Re: ReactPHP: Timers — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/01/reactphp-timers#comment-4342161377</link><description>&lt;p&gt;Thank you for bringing this to my attention. I'll update the ReactPHP series posts and related examples later this week. We changed a few things over the years since these posts.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">WyriHaximus</dc:creator><pubDate>Sun, 17 Feb 2019 15:48:07 -0000</pubDate></item><item><title>Re: ReactPHP: Timers — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/01/reactphp-timers#comment-4328331603</link><description>&lt;p&gt;None of this actually works. addTimer want's an interface :/.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">First</dc:creator><pubDate>Fri, 08 Feb 2019 11:56:55 -0000</pubDate></item><item><title>Re: Test lowest, current, and highest possible on Travis — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/06/test-lowest-current-and-highest-possible-on-travis#comment-4270914585</link><description>&lt;p&gt;Prefer highest extra, or prefer lowest with multiple PHP version is usually overkill, though.&lt;br&gt;Best to assure, though, that you are actually testing against the declared minimum versions. If those arent pulled in that travis job, and clearly there is a hidden issue. I added a composer tool that can help here.&lt;br&gt;&lt;a href="https://www.dereuromark.de/2019/01/04/test-composer-dependencies-with-prefer-lowest/" rel="nofollow noopener" target="_blank" title="https://www.dereuromark.de/2019/01/04/test-composer-dependencies-with-prefer-lowest/"&gt;https://www.dereuromark.de/...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mark S</dc:creator><pubDate>Sat, 05 Jan 2019 11:14:04 -0000</pubDate></item><item><title>Re: ReactPHP: Streams — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/02/reactphp-streams#comment-3915022318</link><description>&lt;p&gt;please update the tutorial for latest update of ReactPHP&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hendrik</dc:creator><pubDate>Thu, 24 May 2018 05:44:19 -0000</pubDate></item><item><title>Re: Github auth token on TravisCI — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/09/github-auth-token-on-travis#comment-3907752829</link><description>&lt;p&gt;Only pulling from github during composer install. But I'll update the post for those that push from travis where is useful :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">WyriHaximus</dc:creator><pubDate>Sat, 19 May 2018 07:24:47 -0000</pubDate></item><item><title>Re: Github auth token on TravisCI — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/09/github-auth-token-on-travis#comment-3907402585</link><description>&lt;p&gt;Really?  How do you do pushes without the token?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Adam P</dc:creator><pubDate>Fri, 18 May 2018 22:15:52 -0000</pubDate></item><item><title>Re: Github auth token on TravisCI — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/09/github-auth-token-on-travis#comment-3906669824</link><description>&lt;p&gt;Yeah and to be honest I should add an out of date banner above this post as you don't need a Github token anymore on Travis&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">WyriHaximus</dc:creator><pubDate>Fri, 18 May 2018 12:39:25 -0000</pubDate></item><item><title>Re: Github auth token on TravisCI — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/09/github-auth-token-on-travis#comment-3906608974</link><description>&lt;p&gt;I don't see Personal Access tokens anywhere on my Github settings screen as it's been moved under Developer Settings.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Adam P</dc:creator><pubDate>Fri, 18 May 2018 12:01:11 -0000</pubDate></item><item><title>Re: ReactPHP: Timers — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/01/reactphp-timers#comment-3900470358</link><description>&lt;p&gt;One of the key purposes of timers is, to have a timed event that really needs to be timed. Avoid over using it when there are other alternatives. Ideally you should actually be setting your timeout on the underlying socket. You wouldn't normally need a timeout on that then as you just select it for read and the kernel will handle the rest. Times for timeout can be more useful for the kind of timeouts that the kernel or underlying library can't handle.&lt;/p&gt;&lt;p&gt;Although it's unfortunate, another handy use of timers in async PHP is to work around areas where PHP doesn't provide async. Anything directly filedescriptor (stream) based in PHP works easily in async. There's a bunch of things that wont though either because the streams or FDs are buried too deeply and not explosed in anyway or because the calls are not FD based.&lt;/p&gt;&lt;p&gt;It's common to use timers to work around that. The only alternative really is to use timesharing event loops which isn't all that great on latency or efficiency (you tend to have to cycle them very fast, what could be one call to select over a second becomes thousands of calls or more) but can work well enough.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">First</dc:creator><pubDate>Mon, 14 May 2018 14:39:38 -0000</pubDate></item><item><title>Re: ReactPHP: Streams — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2015/02/reactphp-streams#comment-3808729593</link><description>&lt;p&gt;The video seems to be cut off, if you try it you'll see it prints 15 as well.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sebastiaan Bakker</dc:creator><pubDate>Fri, 16 Mar 2018 06:56:59 -0000</pubDate></item><item><title>Re: Smoke testing ReactPHP applications with Cigar — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2018/02/smoke-testing-reactphp-applications-with-cigar#comment-3782457803</link><description>&lt;p&gt;No problem, I've updated the blog post anyway removing the () just to be sure it matches expected conventions. Should be in a few hours once the CDN updates&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">WyriHaximus</dc:creator><pubDate>Thu, 01 Mar 2018 15:19:17 -0000</pubDate></item><item><title>Re: Smoke testing ReactPHP applications with Cigar — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2018/02/smoke-testing-reactphp-applications-with-cigar#comment-3779689957</link><description>&lt;p&gt;Thank you for pointing to the post.&lt;/p&gt;&lt;p&gt;I noticed something interesting. The parentheses . When you have function there is no parentheses. Quoting from there.&lt;/p&gt;&lt;p&gt;function_name () {&lt;/p&gt;&lt;p&gt;				&amp;lt;commands&amp;gt;&lt;/p&gt;&lt;p&gt;				}&lt;/p&gt;&lt;p&gt;or&lt;/p&gt;&lt;p&gt;function function_name {&lt;/p&gt;&lt;p&gt;				&amp;lt;commands&amp;gt;&lt;/p&gt;&lt;p&gt;				}&lt;/p&gt;&lt;p&gt;UPDATE : I was running `sh &lt;a href="http://hello.sh" rel="nofollow noopener" target="_blank" title="hello.sh"&gt;hello.sh&lt;/a&gt;` , and not `./&lt;a href="http://hello.sh" rel="nofollow noopener" target="_blank" title="hello.sh"&gt;hello.sh&lt;/a&gt;` . I came across a few things. I was actually wrong about the above. All these are working and is valid after you give permission to execute. ie&lt;/p&gt;&lt;p&gt;chmod +x &lt;a href="http://hello.sh" rel="nofollow noopener" target="_blank" title="hello.sh"&gt;hello.sh&lt;/a&gt;&lt;br&gt;&lt;a href="http://hello.sh" rel="nofollow noopener" target="_blank" title="hello.sh"&gt;hello.sh&lt;/a&gt;&lt;/p&gt;&lt;p&gt;So thanks again.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hari K T</dc:creator><pubDate>Tue, 27 Feb 2018 23:49:17 -0000</pubDate></item><item><title>Re: Smoke testing ReactPHP applications with Cigar — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2018/02/smoke-testing-reactphp-applications-with-cigar#comment-3779286908</link><description>&lt;p&gt;Did some research about this and it seems both formats are supported and valid &lt;a href="https://ryanstutorials.net/bash-scripting-tutorial/bash-functions.php#functions" rel="nofollow noopener" target="_blank" title="https://ryanstutorials.net/bash-scripting-tutorial/bash-functions.php#functions"&gt;https://ryanstutorials.net/...&lt;/a&gt; I'll updated the post tomorrow adding a note about this, thanks for pointing it out 👍&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">WyriHaximus</dc:creator><pubDate>Tue, 27 Feb 2018 17:26:58 -0000</pubDate></item><item><title>Re: Smoke testing ReactPHP applications with Cigar — Cees-Jan Kiewiet's blog</title><link>https://blog.wyrihaximus.net/2018/02/smoke-testing-reactphp-applications-with-cigar#comment-3778399605</link><description>&lt;p&gt;Is there a typo in the bash script ?&lt;/p&gt;&lt;p&gt;The code with `function main()`  gives me error as `Syntax error: "(" unexpected` .&lt;/p&gt;&lt;p&gt;But if I do something like the below it works.&lt;/p&gt;&lt;p&gt;```&lt;br&gt;#!/bin/bash&lt;/p&gt;&lt;p&gt;main() &lt;br&gt;{&lt;br&gt;    echo "Hello World"&lt;br&gt;}&lt;/p&gt;&lt;p&gt;main&lt;br&gt;```&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hari K T</dc:creator><pubDate>Tue, 27 Feb 2018 07:33:52 -0000</pubDate></item></channel></rss>