Using the select syscall from Rust, with the libc crate

Disclaimer

  1. I am not a Rust expert, I am just getting started, so please take everything you read here with a grain of salt.
  2. You probably don’t want to use any of this in production code. There are libraries written by actual Rust developers providing similar features, in a way that…

What does the “ampersand, symbol” thingy as an argument to a ruby method actually do? It creates a proc.

What’s with this weird looking syntax with an ampersand and a symbol

When &:object_id is used as an argument to a method call, it will convert the symbol :object_id into a Proc instance with the Symbol#to_proc method.

This syntax is really useful when mixed with Enumerable methods such as map and select:

irb(main):001:0> [ 1, 2, 3, 4, 5 ].select(&:even?)
=> [2, 4]
irb(main):002:0>…

In this chapter we will write our own hash table. This will allow to remove uses of the Ruby Hash class and use our Dict class, built from scratch.

This article is part of a series, Redis in Ruby, originally published at https://redis.pjam.me/. All chapters are available on Medium as well: https://medium.com/@pierre_jambet

What we’ll cover

So far we’ve been using the Ruby Hash class as the main storage mechanism for the key/value pairs received through the SET command. We also use it…

In this chapter we will focus on making RedisServer speak the Redis Protocol, RESP. Doing so will allow us to use Redis’ built-in client, redis-cli to communicate with our own server.

This article is part of a series, Redis in Ruby, originally published at https://redis.pjam.me/. All chapters are available on Medium as well: https://medium.com/@pierre_jambet

What we'll cover

By the end of this chapter RedisServer will speak the Redis Protocol, RESP v2. Doing this will allow any clients that was written to communicate with the…

Photo by hannah joshua on Unsplash

This article is part of a series, Redis in Ruby, originally published at https://redis.pjam.me/. All chapters are available on Medium as well: https://medium.com/@pierre_jambet

What we’ll cover

We implemented a simplified version of the SET command in Chapter 2, in this chapter we will complete the command by implementing all its options. …

A followup to the previous post about Railway Oriented Programming in Scala, adding support for parallel validations

Multiple parallel train tracks

Combining functions in parallel

In the previous post we attempted to translate the main F# constructs from the original Railway Oriented Programming (ROP) documents — the blog posts & the slide deck — to Scala. We also showed what an alternative approach looks like using Scala’s built-in class. The code is on GitHub. …

pierre jambet

Software Engineer by day, Runner by day as well.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store