UWP中的后台代理 [英] Background Agent in UWP

查看:78
本文介绍了UWP中的后台代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 8.1和WP 8.1中,后台代理的工作方式略有不同:

In Windows 8.1 and WP 8.1, there was a slight difference between the way Background Agent used to work:

WinRT: 在WinRT中,大多数情况下,当后台代理耗尽配额后,操作系统将终止后台代理. 取而代之的是,它将简单地挂起该代理,并允许它稍后继续.暂停操作没有任何警告,例如 引发事件或调用回调. 当后台代理变得空闲时(例如,等待服务器的命令响应时),操作系统将停止后台代理.

WinRT: In WinRT, in most cases the OS will not terminate the background agent when the background agent exhausts its quota. Instead it will simply suspend the agent and allow it to continue later. The suspension is done without any warning like an event being raised or callback called. The OS will not stop the background agent when it becomes idle (for example when waiting for a command to the server to respond).

赢得手机: 在Win Phone中,当后台代理用完配额后,操作系统将终止后台代理.此终止 将在没有警告的情况下完成. 在Win Phone中,当发现后台代理处于空闲状态时,操作系统将停止后台代理.在这种情况下,操作系统将引发IBackgroundTaskInstance.Canceled.

Win Phone: In Win Phone, the OS will terminate the background agent when the background agent exhausts its quota. This termination will be done with no warning. In Win Phone, the OS will stop the background agent when the background agent is found to be idle . In this situation the OS will raise IBackgroundTaskInstance.Canceled.

我的问题是,Windows 10移动版和Windows 10台式机之间是否有这种区别?

My question is, is there any such difference between Windows 10 mobile and Windows 10 desktop?

推荐答案

在Windows 10中,后台代理已替换为视频由Microsoft在Ignite 2015活动期间制作.

In windows 10 Background Agent has been replaced with Background Task. Whatever the type of W10 device (mobile or desktop) it's running on, a standard background task will have 5 seconds to complete its job after receiving the cancel event. Once the 5 seconds have elapsed, the background task will be terminated. The cancel event may be triggered by the user or by the system if quotas (CPU, memory or network) have been exceeded. What is variable from one W10 device to another are both the Memory and Network thresholds used to terminate the task. If you want to learn more about W10 Background tasks, I highly encourage you to watch this video that was made by Microsoft during Ignite 2015 event.

这篇关于UWP中的后台代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆