I've added search and trim to my expiring records module in Erlang. This started out as an in-memory key/value store, that I then migrated over to using Mnesia and eventually to a replicated Mnesia table. The fetch/1 function is already doing a simple query, with match_object . Result = mnesia : match_object ( expiring_records , # record { key = Key , value = '_' , expires_at = '_' }, read ) The three parameters there are the name of the table - expiring_records , the matching pattern and the lock type (read lock). The fetch/1 function looks up the key as it was added to the table with store/3 . If the key is a tuple, we can also do a partial match: Result = mnesia : match_object ( expiring_records , # record { key = { '_' , " bongo " }, value = '_' , expires_at = '_' }, read ) I've added a search/1 function the module that takes in a matching pattern and ...
I am a software architect at CCP Games. Work on the launcher, Wine support, graphics engine and other random stuff for EVE Online, usually low level. This blog details some interesting things I run into at work, as well as new things I'm trying out in my spare time. Lately I've been picking up new programming languages - Erlang/Elixir, Go, Swift whereas most of my work in the past is in C++ and Python.