Challenge: Convert Synchronous Method to Async
Tehtävä
Swipe to start coding
Refactor the provided synchronous DownloadFile method so that it becomes asynchronous using async and await. The current version blocks the thread for 3 seconds to simulate a file download.
- Modify the method so that it does not block the calling thread.
- Replace the blocking call with an asynchronous alternative that simulates a 3-second delay.
- Ensure the method uses the correct async method signature and is called appropriately from
Main.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 2
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 5.56
Challenge: Convert Synchronous Method to Async
Pyyhkäise näyttääksesi valikon
Tehtävä
Swipe to start coding
Refactor the provided synchronous DownloadFile method so that it becomes asynchronous using async and await. The current version blocks the thread for 3 seconds to simulate a file download.
- Modify the method so that it does not block the calling thread.
- Replace the blocking call with an asynchronous alternative that simulates a 3-second delay.
- Ensure the method uses the correct async method signature and is called appropriately from
Main.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 2
single