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

chore: rename topics doc sample snippets #113

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Examples/doc-example-apis/Sources/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func example_API_InstantiateTopicClient() {
}

@available(macOS 10.15, iOS 13, *)
func example_API_Publish(topicClient: TopicClient, cacheName: String) async {
func example_API_TopicPublish(topicClient: TopicClient, cacheName: String) async {
let result = await topicClient.publish(
cacheName: cacheName,
topicName: "topic",
Expand All @@ -133,7 +133,7 @@ func example_API_Publish(topicClient: TopicClient, cacheName: String) async {
}

@available(macOS 10.15, iOS 13, *)
func example_API_Subscribe(topicClient: TopicClient, cacheName: String) async {
func example_API_TopicSubscribe(topicClient: TopicClient, cacheName: String) async {
let result = await topicClient.subscribe(cacheName: cacheName, topicName: "topic")
switch result {
case .subscription(let subscription):
Expand Down Expand Up @@ -180,11 +180,11 @@ func main() async {
await example_API_Delete(cacheClient: cacheClient, cacheName: cacheName)

example_API_InstantiateTopicClient()
await example_API_Publish(topicClient: topicClient, cacheName: cacheName)
await example_API_TopicPublish(topicClient: topicClient, cacheName: cacheName)

// make sure to timeout, else this example will cause the program to hang
let subscribeTask = Task {
await example_API_Subscribe(topicClient: topicClient, cacheName: cacheName)
await example_API_TopicSubscribe(topicClient: topicClient, cacheName: cacheName)
}
// timeout in 3 seconds
let timeoutTask = Task {
Expand Down
Loading