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

Make Lambda stateless by default #216

Open
randomir opened this issue Oct 22, 2019 · 0 comments
Open

Make Lambda stateless by default #216

randomir opened this issue Oct 22, 2019 · 0 comments
Labels
breaks compatibility Proposal breaks backwards compatibility feature New feature or request

Comments

@randomir
Copy link
Member

Initially, hybrid.Lambda was made to bind hybrid.Lambda instance as self in next/error/init calls. That allowed runnable implementations via hybrid.Lambda to have access to a persistent state (like any other runnable does).

However, the most common hybrid.Lambda usage pattern these days is actually a stateless runnable.

So, to simplify the common use case, we're making hybrid.Lambda stateless (no reference to self), and we're introducing hybrid.StatefulLambda that'll behave like hybrid.Lambda did so far.

Going forward, the expected usage is:

import hybrid

stateless_workflow = hybrid.Lambda(lambda state: state.updated(...))

stateful_workflow = hybrid.StatefulLambda(lambda self, state: state.updated(...))
@randomir randomir added breaks compatibility Proposal breaks backwards compatibility feature New feature or request labels Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks compatibility Proposal breaks backwards compatibility feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant