Questions tagged «handler»

在观察者模式中,事件处理程序是在观察者上侦听由主体调度的事件的函数或方法。也称为事件监听器。

4
如何创建Looper线程,然后立即向其发送消息?
我有一个工作线程位于后台,用于处理消息。像这样: class Worker extends Thread { public volatile Handler handler; // actually private, of course public void run() { Looper.prepare(); mHandler = new Handler() { // the Handler hooks up to the current Thread public boolean handleMessage(Message msg) { // ... } }; Looper.loop(); } } 从主线程(UI线程,没关系),我想做这样的事情: Worker worker = …


1
调试istio速率限制处理程序
我正在尝试对某些内部服务(在网状内部)应用速率限制。 我使用了文档中的示例,并生成了redis速率限制配置,其中包括一个(redis)处理程序,配额实例,配额规范,配额规范绑定以及应用该处理程序的规则。 这个redis处理程序: apiVersion: config.istio.io/v1alpha2 kind: handler metadata: name: redishandler namespace: istio-system spec: compiledAdapter: redisquota params: redisServerUrl: <REDIS>:6379 connectionPoolSize: 10 quotas: - name: requestcountquota.instance.istio-system maxAmount: 10 validDuration: 100s rateLimitAlgorithm: FIXED_WINDOW overrides: - dimensions: destination: s1 maxAmount: 1 - dimensions: destination: s3 maxAmount: 1 - dimensions: destination: s2 maxAmount: 1 配额实例(目前我仅对按目的地限制感兴趣): …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.