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 router handler functions side-effect free #1374

Open
sstone opened this issue Apr 10, 2020 · 0 comments
Open

Make router handler functions side-effect free #1374

sstone opened this issue Apr 10, 2020 · 0 comments

Comments

@sstone
Copy link
Member

sstone commented Apr 10, 2020

#1352 move router handler methods to separate files, which makes it much more readable, but many of the new helper methods have an akka Context parameter and rely heavily on side-effects (publishing messages, notifications, replying to the sender referenced by the input context...).
It would be worth investigating if these methods can be made pure (for example return a new state and a series of action items). Sync handlers which are complex and rely on different types of side-effects could be a good starting point (see https://github.com/ACINQ/eclair/blob/master/eclair-core/src/main/scala/fr/acinq/eclair/router/Sync.scala)

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

No branches or pull requests

1 participant