3/21/2023 0 Comments Weatherdesk run in backgroundIf you want to use different wallpapers, you must rename them according to the WeatherDesk naming rules and place them in the ~/.weatherdesk_walls/ folder. Now you can simply run "weatherdesk" in a terminal and the app should automatically change your wallpaper based on the current weather conditions and time of day, using the FireWatch wallpaper pack: Tar -xvf /tmp/ -C ~/.weatherdesk_walls/ -strip-components=1 To create the ~/.weatherdesk_walls folder, download the FireWatch WeatherDesk wallpaper set and extract it into the ~/.weatherdesk_walls folder, you can use the following commands: To make this easy, the WeatherDesk GitHub page points to a pack called FireWatch, which already contains images named according to the WeatherDesk rules. The wallpapers must be named according to some naming rules and placed in the ~/.weatherdesk_walls/ folder for WeatherDesk to pick them up. Download the FireWatch WeatherDesk wallpaper packīut wait, we're not done yet! That's because you'll also need some wallpapers to change based on current weather conditions and the time of day. Sudo ln -s /opt/weatherdesk/WeatherDesk.py /usr/local/bin/weatherdeskĪfter this, you can simply use "weatherdesk" in a terminal to run the tool.Ģ. Sudo chmod +x /opt/weatherdesk/WeatherDesk.py Sudo cp /tmp/WeatherDesk-master/*.py /opt/weatherdesk/ As long as the work is fast, this is fine, but if one of those pieces has blocking work, then the ASP.NET thread pool heuristics can be impacted.To simplify things, you can use the commands below to download the latest WeatherDesk code from Git, install WeatherDesk in /opt/ and create a symbolic link to its executable in /usr/local/bin/: sudo apt install wget #in case it's not already installed Each time a piece is scheduled, it takes a thread pool thread, runs the piece, and then returns the thread. One way to think about async/ await is that each method is broken up into pieces (at each await point), and each of those pieces is scheduled separately, one at a time. This is a valid concern if there's blocking work being done during your message processing. It seems if I don't use Task.Run() then every time my background task gets something from the queue and so the code after await continues, then it will be blocking some main thread in ASP that spooled up the task in the first place. A single Task.Run done once at startup doesn't matter. So using Task.Run when processing each HTTP request or when processing each queue item would be a bad idea. Regularly queueing work to the thread pool is a problem, since you're stealing threads and then re-injecting them on a regular basis. The main thing with Task.Run on ASP.NET is that you don't want to interfere with the ASP.NET thread pool heuristics. Task.Run can be useful for background tasks in an ASP.NET process, in particular if there's blocking work done during startup of the background task. It's always inefficient regardless of the type of work being done. Task.Run should be avoided in ASP.NET's request processing pipeline. I have read that for I/O you shouldn't use Task.Run() as it's inefficient The backend process has its own thread pool, so there's no interference with the ASP.NET thread pool.randomly selected (00Z) 1 NAM operational run (12Z) 1 GFS operational run (12Z) 1. Up as high as you want, potentially down to zero. 2 Outline of Webinar Winter Weather Desk(WWD) operational 24 hours/day. Your API (ASP.NET) can scale independently from your backend (Azure Function).Benefits of Azure Functions over ASP.NET in-process include: Azure Functions, for example, has built-in support for Azure Storage Queues. I agree with others' comments: by far the best solution is to move these out of the ASP.NET process completely. These background tasks will run for the entirety of the applications life, and will be reading azure queues so spending a lot of time sitting doing nothing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |