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:

5.3K
active users

#coroutines

3 posts3 participants0 posts today

Why does the Kotlin ecosystem have such a relaxed view to monitoring coroutine dispatchers?

"Trust me, bro. Coroutines fast," seems to be the attitude. If you've got a cooperative multitasking framework like a Kotlin coroutine dispatcher, you're gonna want to know when there's enough coroutines not playing nice that it affects something you care about, and you're going to want to be able to make a call about whether it's an annoying, important or now problem.

There's some sexy code right there.

The coroutine algebra has the types.
I for in
O for Out
R for response
E for error

the source function runs a function to fill the I value (only needed for starting server/client here)

the emiter function takes an R value and turns it into an O value (emitter is Coroutine<Nada,O,Nada,E>, like a regular Event system or Signal)

the secure function uses the output of the emitter, making an effect

then the effect is run, and a Future is returned with optionally an error.

(edit) The coroutines are functional and composable , so inputs can be transformed, transformer functions swaped out, and the return type has a monad instance on it so they can be chained.

Here is an example on how sharing articles via my website looks like after my update today:

Check out this post by João Esperancinha:

Title: Why the Global Scope isn't advised to be used?

Description: Coroutines in action with Kotlin

#GlobalScope #Kotlin #coroutines #lifecycle

joaofilipesabinoesperancinha.n

João Filipe Sabino Esperancinha's HomepageWhy the Global Scope isn't advised to be used?Coroutines in action with Kotlin

oh yeah I posted a blog version of my fennelconf #coroutines talk yesterday: https://technomancy.us/202

(most of my posts are timestamped in UTC but I forgot to use UTC for this one, and then after I published it I noticed it, but then I realized if I fixed it, then it wouldn't have been published in 2024 any more which was half the reason I posted it, so I wouldn't have two years in a row with only one blog post that year)

technomancy.usin which things once suspended are resumed - Technomancy