Automatically clean up request_facilities_list requests once completed

This commit is contained in:
Mihai Dinculescu
2023-02-22 18:41:01 +00:00
parent e074d708d8
commit 93ab001d48
5 changed files with 108 additions and 16 deletions

View File

@@ -26,8 +26,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// The returned list is quite large, so we look for a particular record
if record.icao == "EGSC" {
println!("{record:?}");
// we've got the entry we're interesting in - we can unsubscribe now
client.unsubscribe_to_facilities(FacilityType::Airport)?;
// there's no need to unsubscribe
// because this is a one-off request, not a subscription
}
}
}