eliseomartelli
HomeBlogPhotosAbout

Introducing: Micromachine

Feb 18, 2025 - ⏱️ 1 minute to read

I'm pleased to announce the release of Micromachine, a new open-source library designed to simplify state management in Go applications.

What is Micromachine?

Micromachine is a generic state machine implementation in Go that allows you to define states and transitions between them. It supports any comparable type for states and ensures thread safety, making it ideal for concurrent applications. With Micromachine, you can define custom actions to be executed during state transitions and check if a transition is valid before attempting it.

Key Features

  • Generic State Management: Supports any comparable type for states, providing flexibility in defining your state machine.
  • Thread Safety: Ensures that concurrent access is handled correctly, making it suitable for multi-threaded applications.
  • Custom Actions: Define custom actions to be executed during state transitions, allowing for complex state management logic.
  • Transition Validation: Check if a transition is valid before attempting it, preventing runtime errors.

Why Micromachine?

Micromachine was born out of the need for a simple yet powerful state management solution in Go. As a developer, I often found myself implementing state machines from scratch, which was time-consuming and error-prone. Micromachine aims to solve this problem.

You can check out the Micromachine repository and start using it today.

Subscribe to RSS

Writing

Here are some of my thoughts.

Newsletter

Stay in the loop and get news about what I have my eyes on!

Past Issues