mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

8.2K
active users

#async

5 posts4 participants0 posts today

Swift concurrency. Executors, Actors и их связь с потоками

В данной части из серии статей мы погрузимся чуть глубже в недра Swift Concurrency. Как определяется поток, на котором будет выполняться Task? Почему в рамках одной Task поток может меняться? Что такое Executor и на какие типы он делится? За что отвечает TaskExecutor, а за что SerialExecutor? Как определить текущий Executor по коду? Как использовать свой самописный Executor? В этой статье ответим на эти (и многие другие) вопросы.

habr.com/ru/articles/887240/

ХабрSwift concurrency. Executors, Actors и их связь с потокамиВ данной части из серии статей мы погрузимся чуть глубже в недра Swift Concurrency. Как определяется поток, на котором будет выполняться Task? Почему в рамках одной Task поток может меняться? Что...

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