The Crystal Programming Language Forum

Live coding a URL status checker in Crystal

Hi all :wave: I’d like to share a bunch of live coding sessions I’ve streamed on Twitch.

The idea is to explore Crystal’s concurrency, with emphasis on Channels, Fibers and the CSP model, by means of building a simple terminal-based app.

Here is the table of content so far.

Session 1

  1. Initialising a Crystal app
  2. Making HTTP calls
  3. Reading from config files
  4. Concurrently checking URLs with Channels and Fibers

Session 2

  1. Classes and aliases
  2. Extracting tasks into modules
  3. Scheduling periodic tasks

Session 3

  1. Type-safe config handling
  2. Sensible monkey patching
  3. Logging across Fibers
  4. Signals, timers and select statement

Session 4

  1. Fibers owning Channels
  2. Terminating groups of Fibers
  3. Propagating Channel closure throughout a pipeline
  4. Waiting for a pipeline to be done

I recommend watching the videos at 1.5x the regular speed for better enjoyment :robot:
I’ll add new ones as they come, in the comment section.

I would love to hear your suggestion on related topic I could include! I’m currently running a poll to pick this Sunday’s subject:
image

7 Likes

Thank you so much for doing this! Especially Fibers related stuff.

1 Like

Session 5 is out!

We talk about two-way communication between Fibers, taking inspiration from Elixir’s GenServer and Akka’s Actor. Hope you enjoy this!

2 Likes

Session 6 is out :tada:

We talk about

  1. Partitioning and merging channels
  2. Processing data on a sliding window. In particular, we define a processor to compute the moving average on a set of response times.

Make sure you don’t watch all the videos in parallel :grin:

2 Likes