Skip to content

Latest commit

 

History

History
28 lines (15 loc) · 1017 Bytes

README.md

File metadata and controls

28 lines (15 loc) · 1017 Bytes

go-statemachine

Build Status

Transform your Go structs into tiny state machines.

About

In Go you quite often need to make your struct thread-safe (basically serialize all the calls to any of its methods) and also allow only particular sequences of calls, e.g. when Close is called, no other method can be called ever again since it does not make sense to call it. And this is exactly what go-statemachine is handling for your.

No mutexes are being used, just channels. It might not be as fast as mutexes, but it's nice and robust.

State of the Project

I am still developing this, so things may and will change if I find it more appropriate for my use cases.

Example

Check ExampleStateMachine in statemachine_test.go to see an example.

Documentation

We are writing Go, so GoDoc, what were you expecting?

License

MIT