Using RequestStore with asynchronous I/O in Rails apps

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • Async Ruby

    An awesome asynchronous event-driven reactor for Ruby. (by socketry)

  • You can use the Async gem and the Falcon web server to take advantage of this capability. And starting in Ruby 3.0, async I/O is even more automatic because inside the Ruby runtime, all socket operations will automatically yield the current fiber by default. It’s fully transparent to the developer. Your I/O calls appear to be blocking so they are easy to understand, consistent with Ruby’s “programmer happiness” philosophy.

  • falcon

    A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS. (by socketry)

  • You can use the Async gem and the Falcon web server to take advantage of this capability. And starting in Ruby 3.0, async I/O is even more automatic because inside the Ruby runtime, all socket operations will automatically yield the current fiber by default. It’s fully transparent to the developer. Your I/O calls appear to be blocking so they are easy to understand, consistent with Ruby’s “programmer happiness” philosophy.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • request_store-fibers

    Lets you use `RequestStore` with a fiber-based server.

  • To fix this I wrote a new request_store-fibers gem that detects whenever a new fiber is created by hooking into Fiber.new. Before the fiber is executed, I copy the current request_store data into a variable. Then as soon as the fiber is resumed the very first time, I copy that data into the fiber's request_store.

  • fiber_hook

    Lets you hook into `Fiber.new` and `Fiber.resume`

  • request_store-fibers is actually a thin layer on top of another more generic gem I wrote, fiber_hook, which does all the magic. It lets you hook into fiber creation and do anything you want right after any fiber is created and before it executes.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Java's Cultural Problem

    1 project | /r/programming | 19 Sep 2022
  • Newb here: have you written your own web server? Seeking advice

    13 projects | /r/ruby | 18 Jun 2022
  • Ho would you go on about creating async rest api in rails

    1 project | /r/rails | 21 Mar 2022
  • Ask HN: Coming back to Web/Ruby/Rails since 2012. Help?

    1 project | news.ycombinator.com | 5 Mar 2021
  • Would you consider Rails as stable nowadays ?

    2 projects | /r/rails | 8 Dec 2023