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

Add function to RelayDelegate to receive all relay response types #164

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

tyiu
Copy link
Contributor

@tyiu tyiu commented Jun 26, 2024

The main purpose of this change is that there is currently no way for consumers of the library to reasonably manage their relay subscriptions.

For example, if they wanted to subscribe to events up to only what is stored on the relay, but they do not want to receive any new live events that come in, they will want to close their subscription after receiving an EOSE (end of stored events) response rather than keeping the subscription perpetually open.

By allowing folks to listen on all types of relay responses (not just ones with Nostr events), it provides more flexibility to the developer in maintaining the state of their application.

Sources/NostrSDK/Relay.swift Outdated Show resolved Hide resolved
Base automatically changed from tyiu/fix-swiftlint-errors to main June 26, 2024 11:36
Copy link
Collaborator

@bryanmontz bryanmontz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave some suggestions.

Sources/NostrSDK/Relay.swift Outdated Show resolved Hide resolved
Tests/NostrSDKTests/RelayTests.swift Outdated Show resolved Hide resolved
@tyiu tyiu force-pushed the tyiu/relay-delegate-receive-all-response-types branch from 2cd9827 to 49e86c9 Compare June 26, 2024 13:23
@tyiu tyiu merged commit 0d47f6d into main Jun 26, 2024
4 checks passed
@tyiu tyiu deleted the tyiu/relay-delegate-receive-all-response-types branch June 26, 2024 13:25
RandyMcMillan pushed a commit to RandyMcMillan/nostr-sdk-ios that referenced this pull request Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants