user-pic

Christian Hansen

Subscribe to feed Recent Actions from Christian Hansen

  • Christian Damen commented on Time::Moment vs DateTime

    Gonna migrate our PERL5 applications from DateTime => Time::Moment. Thanks for all the efforts.

  • TFBW commented on Supercharge Event Loops with Thread::Subs

    Thread::Subs spawns worker threads once at startup; the cost per sub-call involves making a shared clone of the arguments and managing the queues, not creating new threads. This is one of the reasons I went with a static worker pool model: all the threads are created early when the copy cost is smallest.

    There are limitations associated with passing objects to and from thread subs, as not all objects meet the requirements of threads::shared data, but you can select which subs you want to parallelise. You can continue to use modules which are not thread-safe in the main thread.

  • Nerdvana commented on Websockets in Catalyst

    Thanks!

  • john napiorkowski commented on Websockets in Catalyst

    Instead of reaching into $env, you want want to look at the -> io_fh method in Catalyst::Request. We added this and some other PSGI 'jailbreak' features to Catalyst about 13 years ago. Sadly the Advent site is gone but the articles remain on github:

    https://github.com/perl-catalyst/2013-Advent-Staging/tree/master/1to4-Nonblocking-Streaming/eg

    https://github.c…

  • Nerdvana commented on Websockets in Catalyst

    Wow, indeed I missed this. To be fair, the mechanism of not writing the response as a side effect of accessing an attribute on the Request object is a bit unintuitive and undocumented... but if I had grepped the source for 'websocket' I would have found

    ```
    # Support skipping finalize for psgix.io style 'jailbreak'. Used to support
    # stuff like cometd and websockets
    if($c->request->_has_io_fh) {
    $c->log_response;
    return;
    }
    ```

    I remember digging through the source code in 2019 and finding that finalize_body and _build_write_fh w…

Subscribe to feed Responses to Comments from Christian Hansen

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.