Function open_notify::init[][src]

pub fn init(
    latitude: f64,
    longitude: f64,
    altitude: f64,
    n: u8,
    poll_mins: u64
) -> Receiver
Expand description

Spawns a thread which fetches the current ISS spotting from http://api.open-notify.org periodically.

Parameters

  • latitude: latitude in decimal degrees of the ground station. required Range: -90..90
  • longitude: longitude in decimal degress of the ground station. required Range: -180..180
  • altitude: altitude in meters of the ground station. optional. Range: 0..10000
  • n: number of spotting events to fetch (<=100)
  • poll_mins: Update interval:
    • > 0: duration of poll period in minutes (90 is recommended)
    • = 0: thread will terminate after the first successful update.

Return value

  • open_notify::Receiver: Handle this to open_notify::update() to get the latest ISS spotting update.

    The return value is a mpsc channel receiver:

     pub type Receiver = std::sync::mpsc::Receiver<Result<open_notify::Spot, String>>;