Skip to content

foresightmobile/json-rpc-websockets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON-RPC WebSockets

JSON-RPC WebSockets is an open-source implementation of JSON-RPC 2.0 using WebSockets.

Inspired by rpc-websockets.

let client = Client()

struct FeedUpdatedParameters: Codable {

}

// Subscribe to receiving notifications from the server.
try client.subscribe(to: "feedUpdated", type: FeedUpdatedParameters.self)

// Execute a closure when a subscribed notification has been received.
client.on(method: "feedUpdated", type: FeedUpdatedParameters.self) { parameters in

}

let parameters = FeedUpdatedParameters()

// Send a notification to the server.
client.notify(method: "openedNewsModule", parameters) { result in 

}

// Connect to the server.
client.connect(url: url) {

}

// Disconnect from the server.
client.disconnect {

}

Compatibility

JSON-RPC WebSockets follows SemVer 2.0.0.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 100.0%