<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>aspeer</title>
    <link rel="alternate" type="text/html" href="https://blogs.perl.org/users/aspeer/" />
    <link rel="self" type="application/atom+xml" href="https://blogs.perl.org/users/aspeer/atom.xml" />
    <id>tag:blogs.perl.org,2009-11-03:/users/aspeer//4880</id>
    <updated>2026-08-22T02:00:05Z</updated>
    <subtitle>A blog about the Perl programming language</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>WebDyne 3.0 released -- now with PAGI, Server-Sent Events and WebSockets</title>
    <link rel="alternate" type="text/html" href="https://blogs.perl.org/users/aspeer/2026/08/ive-released-webdyne-30-an.html" />
    <id>tag:blogs.perl.org,2026:/users/aspeer//4880.12100</id>

    <published>2026-08-22T01:47:43Z</published>
    <updated>2026-08-22T02:00:05Z</updated>

    <summary>I’ve released WebDyne 3.0, an update to the Perl-based dynamic HTML engine I have created. The biggest addition in 3.0 is support for PAGI, alongside the existing PSGI and Apache/mod_perl backends. PAGI support brings an asynchronous/event-oriented interface to WebDyne and...</summary>
    <author>
        <name>Andrew Speer</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="https://blogs.perl.org/users/aspeer/">
        <![CDATA[<p>I’ve released WebDyne 3.0, an update to the Perl-based dynamic HTML engine I have created.</p>

<p>The biggest addition in 3.0 is support for PAGI, alongside the existing PSGI and Apache/mod_perl backends.</p>

<p>PAGI support brings an asynchronous/event-oriented interface to WebDyne and allows WebDyne applications to handle more than conventional HTTP request/response traffic:</p>

<ul>
	<li><strong>Server-Sent Events (SSE) </strong>for streaming events from Perl applications to browsers</li>
	<li><strong>WebSocket connections</strong> for bidirectional, long-lived connections</li>
	<li>Normal asynchronous <strong>HTTP requests</strong></li>
	<li>PAGI application <strong>lifespan startup/shutdown events</strong></li>
</ul>
WebDyne’s PAGI implementation has dedicated handlers for HTTP, SSE, WebSocket and lifespan scopes, while exposing the PAGI request environment through the normal WebDyne request interface. This means existing WebDyne concepts can be used while taking advantage of event-driven servers.

<p>WebDyne continues to support HTMX, JSON and API concepts in .psp pages.</p>

<p>There’s also a new webdyne.pagi runner, so getting a PAGI-backed WebDyne application running is straightforward:</p>

<pre>
cpanm Task::WebDyne::PAGI
webdyne.pagi --test
</pre>

<p>or serve a directory of .psp files:</p>

<pre>
webdyne.pagi /var/www/html
</pre>

<p>PAGI support is also built into the WebDyne Docker images.</p>

<p>If unfamiliar with WebDyne, it’s (yet another) Perl dynamic HTML engine that’s been around in various forms for quite a while. It lets you embed Perl in HTML/PSP documents, with compiled-page caching, reusable template blocks and separation of Perl code into modules when applications grow beyond simple pages.</p>

<p>3.0 continues to support PSGI/Plack/Starman and Apache/mod_perl, so PAGI is an additional runtime rather than a replacement for the existing ones.</p>

<p>PAGI gives Perl/WebDyne a clean route into applications that need live server → browser updates or persistent bidirectional connections, without having to bolt a separate WebSocket/SSE service onto the application.</p>

<p>Documentation and examples:</p>

<p><a href="https://webdyne.org">https://webdyne.org/</a></p>

<p>See the "Advanced Usage" section for examples of SSE or WebSockets code.</p>

<p>Source:</p>

<p><a href="https://github.com/aspeer/WebDyne">https://github.com/aspeer/WebDyne</a></p>

<p>Feedback, bug reports and especially experiments with the PAGI/SSE/WebSocket support are welcome.<br />
</p>]]>
        
    </content>
</entry>

</feed>
