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

Simplify Swarm interface #69

Closed
longfin opened this issue Feb 11, 2019 · 1 comment
Closed

Simplify Swarm interface #69

longfin opened this issue Feb 11, 2019 · 1 comment
Assignees
Labels
suggestion Suggestion or feature request

Comments

@longfin
Copy link
Member

longfin commented Feb 11, 2019

Swarm currently exposes mainly three methods:

  • InitAsync(): Initializes the internal objects needed for communication and connects to the registered peers.
  • RunAsync(): Executes event loops to process the message.
  • DisposeAsync(): Dispose the internal objects and requests the registered peers to delete it.

This design has the following problems.

  • RunAsync() can be called before InitContextAsync(). but it raises NoSwarmContextException.
  • it may leave Swarm in a strange state because RunAsync() does not cancel automatically after DisposeAsync().

So I suggest the following interface.

  • StartAsync()
    • Initializes the internal objects.
    • Connects to the registered peers.
    • Executes event loops to process the message.
  • StopAsync()
    • Disposes the internal objects.
    • Requests the registered peers to delete it.
    • Stops event loops.
@longfin longfin changed the title Refactor Swarm interface Simplify Swarm interface Feb 12, 2019
@longfin longfin self-assigned this Feb 12, 2019
@longfin longfin added the suggestion Suggestion or feature request label Feb 12, 2019
@longfin
Copy link
Member Author

longfin commented Feb 22, 2019

A related issue(#72) was merged.

@longfin longfin closed this as completed Feb 22, 2019
dahlia pushed a commit to dahlia/libplanet that referenced this issue Mar 9, 2021
…ublish

Automate build and push docker image
limebell added a commit to limebell/libplanet that referenced this issue Jul 7, 2021
…reorgend

RenderReorgEnd to update ReorgEndSubject
OnedgeLee pushed a commit to OnedgeLee/libplanet that referenced this issue Jan 31, 2023
…rsion

[Fix] Update dotnet verion to 6.0.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Suggestion or feature request
Projects
None yet
Development

No branches or pull requests

1 participant