You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 19, 2019. It is now read-only.
The reason I'm discussion this here is that @hackaugusto said the pattern presented is used in Raiden as well and causes irritation there. Also @andrevmatos mentioned the same problem in a call about the transport layer.
Problem in PFS
Currently the design of the BlockchainListener (BCL) is that it polls for new events in an internal loop and then pushes these events to every registered callback function.
In the PFS the BCL is owned by the PathfindingService class. This results in cycles in the object graph at runtime because the PFS registers callbacks in the BCL.
A different approach would be to remove the callback based approach and use a pulling-based approach in which a function get_events() -> List[Event] would be called that returns a list of events since the last invocation.
Solutions?
In the PFS this doesn't feel like a problem yet but I can see the general problem. Does anyone know about useful patterns for this problem?
The reason I'm discussion this here is that @hackaugusto said the pattern presented is used in Raiden as well and causes irritation there. Also @andrevmatos mentioned the same problem in a call about the transport layer.
Problem in PFS
Currently the design of the BlockchainListener (BCL) is that it polls for new events in an internal loop and then pushes these events to every registered callback function.
In the PFS the BCL is owned by the PathfindingService class. This results in cycles in the object graph at runtime because the PFS registers callbacks in the BCL.
A different approach would be to remove the callback based approach and use a pulling-based approach in which a function
get_events() -> List[Event]would be called that returns a list of events since the last invocation.Solutions?
In the PFS this doesn't feel like a problem yet but I can see the general problem. Does anyone know about useful patterns for this problem?