Soblow, to rust
@Soblow@eldritch.cafe avatar

Is there a way in Rust to use standard lib traits (Ord, Eq, Into/From...) with async functions?
Perhaps a crate or something?
Or must it be a separate function implemented for the structs?

kornel,
@kornel@mastodon.social avatar

@Soblow It's not possible. These traits require returning result immediately, and this is their guarantee that cannot be changed. You need to create your own methods for this, or preload data ahead of time.

reactphp, to php
@reactphp@phpc.social avatar

Just released v3.2.0 of our Promise component! 🎉

Today's release adds initial support for the upcoming PHP 8.4 release, improves reporting unhandled promise rejections and more 🚀

https://github.com/reactphp/promise/releases/tag/v3.2.0

Enjoy! #async #php

atamakahere, to rust
@atamakahere@mastodon.social avatar

What would be the best way to learn #async #rust ?

I am reading the rust for rustaceans book, but it’s not the end of all, I need to implement my learning. What could be the best, short and crisp way to utilise most of async and concurrent feature in a small application?

My goal is to get confident enough that I can build/contribute to something like #pingora or a database like #quadrant

janriemer,

@atamakahere Although the following is "something to watch" and not "to read", it's a really good overview of using async in applications:

1 Hour Dive into Asynchronous Rust | by Ardan Labs:

https://farside.link/https://www.youtube.com/watch?v=0HwrZp9CBD4
(or YT: https://www.youtube.com/watch?v=0HwrZp9CBD4)

On the reading side, I can highly recommend the book "Asynchronous Programming in Rust" by Carl Fredrik Samson:
https://www.packtpub.com/product/asynchronous-programming-in-rust/9781805128137

⚠️ It's more about how Async Rust works under the hood and less about how to develop apps, though.

brennansv, to random
@brennansv@sfba.social avatar

Heard of function coloring? It is about async code. #Concurrency #Async

hywan, to rust
@hywan@fosstodon.org avatar

Tasks are the wrong abstraction, https://blog.yoshuawuyts.com/tasks-are-the-wrong-abstraction/.

Another excellent article by @yosh. I still need to digest it; I reckon it contains many (great) ideas I agree with.

#RustLang #async #concurrency #parallelism

wyri, to php
@wyri@haxim.us avatar

Been putting the finishing touches on Bunny's transformation into #fibers PR. One of the major things for me there is visualizing the changes, especially the breaking changes. For example switching from a promise based API to a fibers based API:

#php @reactphp #async

janriemer, to rust

Clippy's lints for dealing with #async in #Rust:

https://rust-lang.github.io/rust-clippy/master/#/async

(Note, that this is just a search for the term "async" in the Clippy docs - there is no special "category" involved here).

#RustLang #RustAsync #Clippy

toxi, to FunctionalProgramming
@toxi@mastodon.thi.ng avatar

Phew... One key step closer to replicating & simplifying core https://thi.ng/rstream functionality via just standard async iterables: Just added a mult() base-operator to https://thi.ng/transducers-async [1] which allows splitting a single async iterable into multiple child async iterables (aka subscriptions, aka 1:N splitting), each of which can be added/removed dynamically and individually processed e.g. via transducers, vanilla for await() consumers, and/or used as input for downstream mult()s to construct entire graph topologies (cycles allowed) of async processors etc. Back pressure is handled by waiting for all child subscriptions to deliver the value before consuming a new one from the source...

[1] https://github.com/thi-ng/umbrella/blob/develop/packages/transducers-async/src/mult.ts

#ThingUmbrella #Async #Transducers #ReactiveProgramming #FunctionalProgramming #TypeScript #JavaScript

toxi, to typescript
@toxi@mastodon.thi.ng avatar

For @made and others who might have questions about the new https://thi.ng/transducers-async library, I've tried to illuminate the behind-the-scenes approach over here:

https://github.com/thi-ng/umbrella/discussions/461#discussioncomment-9102966

alvinashcraft, to dotnet
@alvinashcraft@hachyderm.io avatar

My book on parallel programming & concurrency in C# is part of the Mastery of C# and .NET Awaits Humble Bundle from Packt Publishing

for up to 22 eBooks!

https://www.humblebundle.com/books/mastery-c-sharp-and-dot-net-awaits-packt-books?partner=morningdew

toxi, to opensource
@toxi@mastodon.thi.ng avatar

Sorry for recent silence, if I can summarize most of my past two weeks or so:

"Async all the thi.ngs, what colud posibsyl og wrngo!" [1]

  1. New package https://thi.ng/transducers-async (restarted development after originally stopping it in 2018 due to lack of async iterable support)
  2. Updates to https://thi.ng/rstream (adapters from/to async iterables)
  3. Upcoming, a new & simplified implementation of https://thi.ng/csp (currently still only on a feature branch[2]) for building blocks for Communicating Sequential Processes.
  4. Also still WIP only, async iterable support for https://thi.ng/rdom, i.e. in the same way as rstream subscriptions, such async iterables can soon be directly embedded as component/element bodies or attribute values and then perform pinpointed DOM updates each time their value changes...

As I said, async all the thi.ngs...

[1] h/t @sjb3d for an ancient tweet with a similar sentiment & outcome :)

[2] The CSP package too was somewhat deprecated (for similar reasons) and a while ago I added another alternative CSP implementation via https://thi.ng/fibers, but that package too might see some more refactoring/simplifying by switching to async generators...

#ThingUmbrella #Async #Transducers #OpenSource #TypeScript #JavaScript

made,
@made@mastodon.gamedev.place avatar

@toxi @sjb3d was it so silent? 😅
These async transducers are generators and work a bit like co-routines right? I did not fully look into it, but do you use them within i.e. rstream and rdom to keep a responsive interface? So instead of blocking render() with an expensive .map(…) you could do .next() .next() .render() .next() while i.e. checking fps?

toxi, (edited )
@toxi@mastodon.thi.ng avatar

@made Transducers are not generators, but work with them (or more concretely: transform values obtained from generators). The https://thi.ng/transducers-async package provides 3 sets of functions: async generators (to produce or compose inputs), async transducers (composable value transforms) and async reducers (i.e. to collect transformed values). There's also another set of functions (I call them "evaluators") which allow you to use these transducers & iterables in different ways. Aannnd, also have to point out that you can also use all of the 150+ "normal" (synchronous) transducers & generators from the https://thi.ng/transducers parent package with these new async versions (but NOT the way around)...

For UI purposes (just one of many other intended use cases), the idea is that you can pop an async iterable (with or without transducers) anywhere in your https://thi.ng/rdom component tree, and depending on where it's used, any future values produced by that iterable will be directly reflected in the DOM, exactly like done with rstream subs already... (very sorry, but I'm not quite getting your .next().next()... part of the question, let's maybe take that to GH?)

Ps. In general, there's now quite a bit conceptual overlap between some of these packages (mainly due to historic reasons/factors, e.g. lack of proper async iterator support in browsers/node when I started working on many of these things) - I'm trying to consolidate some of this, but it will take a while...

felixxm, to django
@felixxm@fosstodon.org avatar

Check out my article on #ASGI #deployment options if you want to serve an #async #Django app or explore the world of ASGI servers 🕵️‍♂️ :django: @flydotio #python

https://fly.io/django-beats/asgi-deployment-options-for-django/

reactphp, to php
@reactphp@phpc.social avatar

Just released v1.10.0 of our async HTTP component! 🎉

Today's release introduces our new PSR-7 implementation, better request validation, improves performance, fixes a few bugs and more. 🚀

https://github.com/reactphp/http/releases/tag/v1.10.0

Enjoy! #async #php

jbzfn, to rust
@jbzfn@mastodon.social avatar

🧶 Why choose async/await over threads? - notgull.net

「 Smart programmers try to avoid complexity. So, they see the extra complexity in async/await and question why it is needed. This question is especially pertinent when considering that a reasonable alternative exists in OS threads 」

https://notgull.net/why-not-threads/

#Rust #Async #Threads

ihor, to programming

Even though I came to terms with async functions with years, I still can't shake the feeling that something wrong there. 😏

#async #blocking #nonblocking #programming #meme

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • InstantRegret
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • modclub
  • Youngstown
  • ngwrru68w68
  • slotface
  • osvaldo12
  • kavyap
  • DreamBathrooms
  • Leos
  • thenastyranch
  • everett
  • cubers
  • cisconetworking
  • normalnudes
  • Durango
  • anitta
  • khanakhh
  • tacticalgear
  • tester
  • provamag3
  • megavids
  • lostlight
  • All magazines