0.5.33
Hey everyone, Bref 1.0 is coming next week, are you ready π¬
AWS re:Invent will also be happening from December 1st, expect some pretty cool announcements :) I'll be covering it in the newsletter: serverless-php.news
Oh also, @deleugpn and I (@mnapoli) finally released 7777 π
Enhancements
π π Websocket support π π
Congrats to @danniehansen for adding both:
- a handler class for receiving websocket events in PHP (through API Gateway) in #773
- a simple Websocket client to send events from PHP in #783
In case you didn't know, API Gateway supports websockets and we don't have to maintain connections. That's huge, because it makes websocket fully compatible with PHP's "process and die" execution model. No daemon to run, no persistent connection, just like HTTP requests.
Documentation will be added in 1.0, but here is an example:
class MyHandler extends WebsocketHandler
{
public function handleWebsocket(WebsocketEvent $event, Context $context): HttpResponse
{
echo 'Route key: ' . $event->getRouteKey() . "\n";
echo 'Event type: ' . $event->getEventType() . "\n";
echo 'Body: ' . $event->getBody() . "\n";
echo 'connectionId: ' . $event->getConnectionId() . "\n";
return new HttpResponse('ok');
}
}
You can see a much more complete example in #783