Skip to content

Commit

Permalink
rename subscribe_to_updates() to updater() (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezs authored Jan 18, 2023
1 parent e036087 commit 8ef8063
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/examples/subscribe_runtime_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

// Start a new tokio task to perform the runtime updates while
// utilizing the API for other use cases.
let update_client = api.subscribe_to_updates();
let update_client = api.updater();
tokio::spawn(async move {
let result = update_client.perform_runtime_updates().await;
println!("Runtime update failed with result={:?}", result);
Expand Down
8 changes: 4 additions & 4 deletions subxt/src/client/online_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ impl<T: Config> OnlineClient<T> {
///
/// // high level API.
///
/// let update_task = client.subscribe_to_updates();
/// let update_task = client.updater();
/// tokio::spawn(async move {
/// update_task.perform_runtime_updates().await;
/// });
///
///
/// // low level API.
///
/// let updater = client.subscribe_to_updates();
/// let updater = client.updater();
/// tokio::spawn(async move {
/// let mut update_stream = updater.runtime_updates().await.unwrap();
///
Expand All @@ -150,7 +150,7 @@ impl<T: Config> OnlineClient<T> {
/// });
/// # }
/// ```
pub fn subscribe_to_updates(&self) -> ClientRuntimeUpdater<T> {
pub fn updater(&self) -> ClientRuntimeUpdater<T> {
ClientRuntimeUpdater(self.clone())
}

Expand Down Expand Up @@ -234,7 +234,7 @@ impl<T: Config> OnlineClientT<T> for OnlineClient<T> {
}
}

/// Client wrapper for performing runtime updates. See [`OnlineClient::subscribe_to_updates()`]
/// Client wrapper for performing runtime updates. See [`OnlineClient::updater()`]
/// for example usage.
pub struct ClientRuntimeUpdater<T: Config>(OnlineClient<T>);

Expand Down

0 comments on commit 8ef8063

Please sign in to comment.