techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.6K
active users

#async

2 posts2 participants0 posts today
Continued thread

That's it for the benchmarking! You can find my implementation at github.com/anisse/lbzip2-rs/ ; it's very much PoC-quality code, so use at our own risks! I chose to manually spawn threads instead of using rayon or an async runtime; there are other things I'm not proud of, like busy-waiting instead of condvar for example. 14/N

PoC lbzip2 parallel decompression in Rust. Contribute to anisse/lbzip2-rs development by creating an account on GitHub.
GitHubGitHub - anisse/lbzip2-rs: PoC lbzip2 parallel decompression in RustPoC lbzip2 parallel decompression in Rust. Contribute to anisse/lbzip2-rs development by creating an account on GitHub.

What if your PHP functions could pause, resume, and remember where they left off, like little self-aware scripts? ⏯️

That’s what coroutines are for, and PHP gives you two tools to use them: Generators (since 5.5) and Fibers (in PHP 8.1).

🥔 🔥 I break it all down with real code, plus a hot potato metaphor you won’t forget:
doeken.org/blog/coroutines-in-

doeken.org · Exploring Coroutines in PHPCoroutines are functions that pause and resume with state, allowing flexible, bidirectional control flow in PHP.

JavaScript, wow!🤣

I was under the impression that if a function returns a Promise, it never throws. Rather, in any case, it returns a Promise, rejected if the functions throws something.

But fetch() is a counter-example. Or this on the TypeScript playground:

typescriptlang.org/play/?#code

The crucial thing is. My impression above is true for functions of the form

async f(...): Promise<...> { ... }

Just add the async in the playground to see the difference.

www.typescriptlang.orgTS Playground - An online editor for exploring TypeScript and JavaScriptThe Playground lets you write TypeScript or JavaScript online in a safe and sharable way.

How I normally do #async external programs in my #commonLisp image #embeddableCommonLisp and #uiop (in the notes).

screwlisp.small-web.org/progra

Originally I was writing Kittenette (Closette but for kittens) today, but I ended up wanting to individually treat external processes, especially from #ecl on its own first.

My example is particularly using #cat(1) as an external-process in-memory echo server.

Hope it helps someone. #programming #example

Yes "multi-processing" in the url is ~erroneous.

screwlisp.small-web.orgEmbeddable Common Lisp External Program Asyncronously