/// Checks if a new update is available by waiting for the background thread to finish
/// fetching release info (blocking).
///
/// In practice, this method will block if it has been more than [`UPDATE_INTERVAL`] seconds
/// since last check. In any other instance the updater will return the update status
/// that was cached since last check.
///
/// This method will wait for worker thread (spawned by calling [`init()`]) to deliver release
/// information from remote server.
/// Upon successful retrieval, this method will compare release information to the current
/// vertion of the workflow. The remote repository should tag each release according to semantic
/// version scheme for this to work.
///
/// You should use this method after calling `init()`, preferably after your workflow is done with other tasks
/// and now wants to get information about the latest release.
///
/// # Note
///
/// - Since this method may block the current thread until a response is received from remote server,
/// workflow authors should consider scenarios where network connection is poor and the block can
/// take a long time (>1 second), and devise their workflow around it. An alternative to
/// this method is the non-blocking [`try_update_ready()`].
/// - The *very first* call to this method will always return false since it is assumed that
/// user has just downloaded and installed the workflow.
///
/// # Example
///
/// ```no_run
/// # extern crate alfred_rs;
/// # extern crate failure;
/// use alfred_rs::Updater;
///
/// # use failure::Error;
/// # use std::io;
/// # fn main() {
/// let updater =
///     Updater::gh("spamwax/alfred-pinboard-rs").expect("cannot initiate Updater");
/// updater.init().expect("cannot start the worker thread");
///
/// // Perform other workflow related tasks...
///
/// assert_eq!(true, updater.update_ready().expect("cannot get update information"));
///
/// # }
/// ```
///
/// # Errors
/// Error will be returned :
/// - If worker thread has been interrupted
/// - If [`init()`] method has not been called successfully before this method
/// - If worker could not communicate with server
/// - If any file error or Alfred environment variable error happens
///
/// [`init()`]: struct.Updater.html#method.init
/// [`try_update_ready()`]: struct.Updater.html#method.try_update_ready
/// [`UPDATE_INTERVAL`]: constant.UPDATE_INTERVAL.html
Checks if a new update is available by waiting for the background thread to finish
fetching release info (blocking).

In practice, this method will block if it has been more than [`UPDATE_INTERVAL`] seconds
since last check. In any other instance the updater will return the update status
that was cached since last check.

This method will wait for worker thread (spawned by calling [`init()`]) to deliver release
information from remote server.
Upon successful retrieval, this method will compare release information to the current
vertion of the workflow. The remote repository should tag each release according to semantic
version scheme for this to work.

You should use this method after calling `init()`, preferably after your workflow is done with other tasks
and now wants to get information about the latest release.
Checks if a new update is available by waiting for the background thread to finish fetching release info ( blocking ) . In practice this method will block if it has been more than [ ` UPDATE_INTERVAL ` ] seconds since last check . In any other instance the updater will return the update status that was cached since last check . This method will wait for worker thread ( spawned by calling [ ` init () ` ] ) to deliver release information from remote server . Upon successful retrieval this method will compare release information to the current vertion of the workflow . The remote repository should tag each release according to semantic version scheme for this to work . You should use this method after calling ` init () ` preferably after your workflow is done with other tasks and now wants to get information about the latest release .
pub fn update_ready(&self) -> Result<bool, Error> {
        if self.state.borrow_worker().is_none() {
            bail!("update_ready_sync is deprecated. use init()");
        } else {
            self.update_ready_async(false)
        }
    }
pub fn update_ready ( & self ) -> Result < bool , Error > { if self . state . borrow_worker ( ) . is_none ( ) { bail ! ( " " ) ; } else { self . update_ready_async ( false ) } }
Checks if a new update is available by waiting for the background thread to finish
fetching release info (blocking).
Checks if a new update is available by waiting for the background thread to finish fetching release info ( blocking ) .
&self
note
Since this method may block the current thread until a response is received from remote server,
workflow authors should consider scenarios where network connection is poor and the block can
take a long time (>1 second), and devise their workflow around it. An alternative to
this method is the non-blocking [`try_update_ready()`].
The *very first* call to this method will always return false since it is assumed that
user has just downloaded and installed the workflow.
Since this method may block the current thread until a response is received from remote server workflow authors should consider scenarios where network connection is poor and the block can take a long time ( > 1 second ) and devise their workflow around it . An alternative to this method is the non - blocking [ ` try_update_ready () ` ] . The * very first * call to this method will always return false since it is assumed that user has just downloaded and installed the workflow .
example
None
extern crate alfred_rs;
None
extern crate failure;
None
use failure::error;
None
use std::io;
None
fn main() {
let updater
Updater::gh("spamwax/alfred-pinboard-rs").expect("cannot initiate Updater");
updater.init().expect("cannot start the worker thread").

Perform other workflow related tasks

assert_eq!(true, updater.update_ready().expect("cannot get update information")).
let updater Updater :: gh ( " spamwax / alfred - pinboard - rs " ) . expect ( " cannot initiate Updater " ) ; updater . init () . expect ( " cannot start the worker thread " ) . Perform other workflow related tasks assert_eq! ( true updater . update_ready () . expect ( " cannot get update information " )) .
}
None
errors
Error will be returned :
If worker thread has been interrupted
If [`init()`] method has not been called successfully before this method
If worker could not communicate with server
If any file error or Alfred environment variable error happens

[`init()`]: struct.Updater.html#method.init
[`try_update_ready()`]: struct.Updater.html#method.try_update_ready
[`UPDATE_INTERVAL`]: constant.UPDATE_INTERVAL.html
Error will be returned : If worker thread has been interrupted If [ ` init () ` ] method has not been called successfully before this method If worker could not communicate with server If any file error or Alfred environment variable error happens [ ` init () ` ] : struct . Updater . html#method . init [ ` try_update_ready () ` ] : struct . Updater . html#method . try_update_ready [ ` UPDATE_INTERVAL ` ] : constant . UPDATE_INTERVAL . html