#socket-server #volatile #behind #queries #store #ttl #connection

bin+lib samus

Volatile memory-store behind a socket server that implements simple CRUD queries

2 releases

new 0.1.1 Jan 4, 2025
0.1.0 Jan 4, 2025

#809 in Network programming

Download history 223/week @ 2025-01-01

223 downloads per month

GPL-3.0-or-later

9KB
213 lines

SAMUS

A simple Redis-like volatile memory store behind a socket server.

How to use

Currently, the Samus socket server responds to the following command syntax:

For getting a key: GET <key_name>

For setting a key: SET <key_name> <key_value> <key_ttl>

Note: key values are represented internally as strings. Note: key ttl is given as whole seconds, and is not currently implemented (it will do nothing).

For deleting a key: DELETE <key_name>

Be sure to add a newline character (\n) at the end of your queryies. You can send as many queries as you want as one message (connection) to the socket as a newline seperated list. Make sure to include a trailing newline at the end of the list.

The server will respond with a response to your query. Look for the string __TERM__ in your message. When it appears, the socket server has closed its connection to your client. You will need a new connection to send a new query.

What's next?

  • Message TTL implementation
  • Multi-threaded server capability
  • Refine ergonomics around network protocol

No runtime deps