North-South Load Balancing
of Kubernetes Services with
eBPF/XDP--dport 80 -j REJECT --reject-with icmp-port-unreachable -A KUBE-SERVICES -d 10.96.61.252/32 -p tcp -m comment --comment "default/nginx-64: has no endpoints" -m tcp --dport 80 -j REJECT --reject-with icmp-port-unreachable --dport 80 -j REJECT --reject-with icmp-port-unreachable -A KUBE-SERVICES -d 10.98.85.41/32 -p tcp -m comment --comment "default/nginx-9: has no endpoints" -m tcp --dport 80 -j REJECT --reject-with icmp-port-unreachable --dport 80 -j REJECT --reject-with icmp-port-unreachable -A KUBE-SERVICES -d 10.106.49.80/32 -p tcp -m comment --comment "default/nginx-37: has no endpoints" -m tcp --dport 80 -j REJECT --reject-with icmp-port-unreachable0 码力 | 11 页 | 444.46 KB | 1 年前3
JavaScript Promise迷你书(中文版)..................................................................................... 14 Promise.reject ................................................................................................ .......................................................................................... 59 使用reject而不是throw ........................................................................................ .................................................................................... 108 Promise.reject ................................................................................................0 码力 | 112 页 | 1010.02 KB | 1 年前3
JavaScript Promiseの本 v2.................................................................................... 16 Promise.reject ................................................................................................ resolveとThenable .............................................................................. 65 throwしないで、rejectしよう ................................................................................ 74 DeferredとPromise ................................................................................... 133 Promise.reject ................................................................................................0 码力 | 137 页 | 1.17 MB | 1 年前3
JavaScript Promiseの本 v1.................................................................................... 15 Promise.reject ................................................................................................ resolveとThenable .............................................................................. 61 throwしないで、rejectしよう ................................................................................ 70 DeferredとPromise ................................................................................... 111 Promise.reject ................................................................................................0 码力 | 115 页 | 1.06 MB | 1 年前3
阮一峰 《ECMAScript 6入门》 第三版Promise(function(resolve, reject) { // ... some code if (/* 异步操作成功 */){ resolve(value); } else { reject(error); } }); Promise 构造函数接受一个函数作为参数,该函数的两个参数分别 是 resolve 和 reject 。它们是两个函数,由 JavaScript resolve 函数的作用是,将 Promise 对象的状态从“未完成”变为“成功”(即从 pending 变为 resolved),在异步操作成功时调用,并将异步操作的结果,作为参 数传递出去; reject 函数的作用是,将 Promise 对象的状态从“未完成”变为“失 败”(即从 pending 变为 rejected),在异步操作失败时调用,并将异步操作报出的 错误,作为参数传递出去。 Promise 对象传出的值作为参数。 下面是一个 Promise 对象的简单例子。 function timeout(ms) { return new Promise((resolve, reject) => { setTimeout(resolve, ms, 'done'); }); } timeout(100).then((value) => { console0 码力 | 679 页 | 2.66 MB | 1 年前3
Concurrencyrecord(account, overdraft_of(transaction)); notify_user(account, overdraft_message); reject_transaction(transaction); } Needs synchronization https://godbolt.org/z/YhdcjncYoCppCon 2023 record(account, overdraft_of(transaction)); notify_user(account, overdraft_message); reject_transaction(transaction); } Needs synchronization Data race! https://godbolt.org/z/YhdcjncYoCppCon record(account, overdraft_of(transaction)); notify_user(account, overdraft_message); reject_transaction(transaction); } Incomplete synchronization https://godbolt.org/z/fnovozn8aCppCon0 码力 | 160 页 | 2.91 MB | 6 月前3
ES6 Tutorialpromise executes successfully and reject is the function that should be called when the promise encounters an error. let p =new Promise(function(resolve,reject){ let workDone=true; // some function passed resolve('success promise completed') } else{ reject('ERROR , work could not be completed') } }) Example The example given below shows function add_positivenos_async(n1, n2) { let p = new Promise(function (resolve, reject) { if (n1 >= 0 && n2 >= 0) { //do some complex time consuming0 码力 | 435 页 | 4.00 MB | 1 年前3
ThinkJS 2.0 中文文档����������� ������������������������� ThinkJS ��� think.prevent ������������������������������� Reject Promise ����� ���� think.prevent ������������������� think.defer().promise �� �� Pending Promise process.nextTick(function(){ if(xxx){ deferred.resolve(data); }else{ deferred.reject(err); } }) return deferred.promise; } JavaScript �� �� callback ������� Deferred function(){ return new Promise(function(resolve, reject){ process.nextTick(function(){ if(xxx){ resolve(data); }else{ reject(err); } }) }) } JavaScript0 码力 | 238 页 | 1.87 MB | 1 年前3
BabelJS Tutorialone argument, which is a callback function. The callback function has two arguments - resolve and reject; BabelJS 37 both these are internal functions. The asynchronous code which called; otherwise, the reject function is called with the error details. The following line of code shows a promise structure call: var _promise = new Promise (function(resolve, reject) { var success success = true; if (success) { resolve("success"); } else { reject("failure"); } }); _promise.then(function(value){ //once function resolve gets called it comes over here0 码力 | 173 页 | 2.70 MB | 1 年前3
ThinkJS 2.2 Documentationif(err){ deferred.reject(err); }else{ deferred.resolve(body); } }); } To convert it to promise style, you should create an deferred object to resolve or reject in callback function think.prevent for preventing the subsequent logic to execute. This method returns a specific type of Reject Promise. think.middleware('parse_xml', async http => { let payload = await http.getPayload(); process.nextTick(function(){ if(xxx){ deferred.resolve(data); }else{ deferred.reject(err); } }) return deferred.promise; } The way using Deferred is much cleaner than the0 码力 | 156 页 | 2.62 MB | 1 年前3
共 953 条
- 1
- 2
- 3
- 4
- 5
- 6
- 96













