Coder Social home page Coder Social logo

ifn / go-statemachine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tchap/go-statemachine

0.0 1.0 0.0 119 KB

Transform your Go structs into tiny state machines

Home Page: http://godoc.org/github.com/tchap/go-statemachine

License: MIT License

Go 100.00%

go-statemachine's Introduction

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

go-statemachine's People

Contributors

ifn avatar tchap avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.