brndnmtthws

brndnmtthws

I’d like to announce a new library I wrote recently for a project I’ve been working on. The library is called Citrine, it’s for managing and running scheduled jobs on an Erlang cluster as part of an existing application.

Summary: With Citrine you define a job, schedule it using cron syntax, and the library manages execution globally across the cluster to keep jobs running continuously. It’s designed to be used in stateless application environments such as Kubernetes.

# Create a job
job = %Citrine.Job{
  id: "my_job_id",
  schedule: "* * * * * *", # Run every second
  task: job_task,
  extended_syntax: true # Use extended cron syntax
}
# Start or update a job
MyApp.Scheduler.put_job(job)
# Terminate and delete a job
MyApp.Scheduler.delete_job(job)

Why I made this: I spent quite a bit of time looking into some of the existing libraries that existed, and none of them did exactly when I wanted, so I decided to build my own. It uses mnesia for state management, and mostly relies on Erlang primitives for everything. Thus, there are very few external dependencies (currently it only uses the crontab library, which itself has almost zero dependencies).

Some other thoughts: I followed convention over configuration with this library. As such, there aren’t many options to change, and the API interface itself really only has 3 function (put a job, delete a job, and list jobs).

Docs: Citrine — Citrine v0.1.11

Showing Posts 1 to 2

hauleth

hauleth

What are main differences between this and Quantum?

brndnmtthws

brndnmtthws OP

Initially I was using Quantum, but I found that the global mode it came with was not working properly. The reasons are documented in this GitHub issue. To be fair, it looks like there’s been a lot of progress since I last used it.

I also looked into using the Horde CRDT library instead of mnesia, but I found it to be too buggy and unreliable. I spent a few days working on resolving the bugs in Horde (you can see my fork here if you want) but it was taking up too much time and I needed to focus on other things.

I ended up just writing a really small library to do exactly what I needed, and I decided to clean it up and open source it for anyone to use.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
kip
I’ll shortly be launching Text, a nascent text analysis library. Current functionality In this early version (not ready for prime time) ...
New
kip
Following on from my CLDR lbraries I started work on Unicode transforms. But like everything related to CLDR there is a lot of yak-shavin...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews