eclair icon indicating copy to clipboard operation
eclair copied to clipboard

Make router handler functions side-effect free

Open sstone opened this issue 5 years ago • 0 comments

https://github.com/ACINQ/eclair/pull/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)

sstone avatar Apr 10 '20 12:04 sstone