Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

Component architecture #19

@palango

Description

@palango

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions