Things to consider when rewriting code to use the new async/await syntax provided by Future::AsyncAwait. The Future class provides basic asynchronous future functionality, and also a number of handy building-blocks for building larger code structures into meaningful programs. With the addition of the async/await syntax provided by
Overview of a new syntax module for managing Future-based code IntroductionAt Binary, we have an increasing amount of code that uses Futures to represent asynchronous operations. The power of these objects comes with the increased complexity of writing readable code that makes use of them. Various articles I have previously
Caching the results of Future-returning functions Often when making read requests or queries to some external service, it is helpful to cache the results of these queries so that other requests for the same information can use that directly, rather than having to repeat the query to that same service.
Limiting Concurrency in Future-based Programming Sometimes a Future-based program needs to actively avoid concurrency in one specific way or area, and ensure that only one instance of a given operation is outstanding at any one time. While the program as a whole can make use of concurrency to do multiple
Sometimes you want to process the EXPLAIN output in SQL. Unfortunately, EXPLAIN itself does not offer that option. However, there are tricks... Wrapping EXPLAIN in a function This is probably the simpler version. It requires to create a function: CREATE OR REPLACE FUNCTION explain( p_q TEXT, p_mod TEXT[