Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for metadata #63

Merged
merged 8 commits into from
Dec 23, 2020
Merged

Support for metadata #63

merged 8 commits into from
Dec 23, 2020

Conversation

aman-sai
Copy link
Contributor

  • Added a feature such that data can be stored at the fsm level that can be used across the callbacks
  • Refer to data.go in examples for demonstration of this feature

@maxekman
Copy link
Member

I don't think this belongs in the library, at least not in this form. If you could me it optional in some way I might consider it.

@TheBeachMaster
Copy link

This is a very neat feature.

Being able to transition between states , in my use case for example, I need the data the previous state had (maybe the user entered some info that I need in the next state)

Instead of adding another dependency eg sqlite to track the data...

Copy link
Member

@maxekman maxekman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some feedback on implementation and naming.

fsm.go Outdated Show resolved Hide resolved
fsm.go Outdated Show resolved Hide resolved
fsm.go Outdated Show resolved Hide resolved
fsm.go Show resolved Hide resolved
fsm.go Outdated Show resolved Hide resolved
@maxekman
Copy link
Member

Sorry for all the comments! 🙂

@TheBeachMaster
Copy link

Really looking forward to having this feature... Great work @aman-sai and @maxekman for taking your time on it...

happy holidays 🎄

@aman-sai
Copy link
Contributor Author

Sorry for all the comments! 🙂

No problem.Glad we had the discussion.Being new to golang ,I learned quite a few things from this.

Copy link
Member

@maxekman maxekman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition and Merry Christmas!

@maxekman maxekman merged commit 01565a8 into looplab:master Dec 23, 2020
wahyurudiyan pushed a commit to ruang-guru/fsm that referenced this pull request Mar 15, 2021
* added data feature

* added commit for NoDataError

* added NoDataError

* added data.go to demonstrate usage of data feature

* renamed data to metadata

* removed key level locks from metadata

* removed NoDataError

Co-authored-by: Aman Sai Ankam <aman.sai@PP-C02CP5SYMD6M.local>
@maxekman maxekman changed the title Data feature Support for metadata Aug 17, 2021
@zhenyanovikov
Copy link

Cool feature! But i have some worries about similarity of metadata to ctx.Value(), which is build-it package.
Not sure, but maybe it make sense to make it underhood just a context?

@maxekman
Copy link
Member

@zhenyanovikov Good observation! That might be useful. Any thoughts @aman-sai and others here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants