DEV Community

Cover image for Introducing Humming-Bird v3
Rawley Fowler
Rawley Fowler

Posted on

4 1 1 1 1

Introducing Humming-Bird v3

Hey folks! It's been a while!

I've been busy, but I haven't forgotten about Humming-Bird. Actually I've been quite busy trying to figure out Web-Sockets, and swappable back-ends for Humming-Bird, features requested by many!

Web-Sockets have been put on the back-burner for a bit, but swappable back-ends, and many bug-fixes have been completed leading to a new version bump.

A lot has changed, and I'm excited to see what sort of back-ends the community may come up with.

To implement a Humming-Bird back-end, simply write a class that does Humming-Bird::Backend;, and implement the listen routine, with a single argument of a function that takes a Humming-Bird::Glue::Request and returns a Humming-Bird::Glue::Response:

use Humming-Bird::Glue;

unit role Humming-Bird::Backend::MyBackend;

method listen(&handler) {
    my $request  = Humming-Bird::Glue::Request.decode(somehow-get-http-request());
    my $response = &handler($request);
    somehow-send-http-response($response.encode);
}
Enter fullscreen mode Exit fullscreen mode

Now in your Humming-Bird app add the following to the listen clause:

use Humming-Bird::Core;

get('/', -> $request, $response {
    $response.html("Hello World!");
});

listen(:backend(Humming-Bird::Backend::MyBackend));
Enter fullscreen mode Exit fullscreen mode

Thanks for reading, Raku rocks!

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

Top comments (1)

Collapse
 
raiph profile image
raiph

To implement a Humming-Bird back-end, simply write a class that does Humming-Bird::Backend ...:

While I know Raku so can guess what you mean, your example doesn't show any class that does anything, which might confuse newbie Rakoons.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay