Last active
March 22, 2024 20:15
-
-
Save hobione2k/c9f7e120a6f993432e3d14c82acb4cb8 to your computer and use it in GitHub Desktop.
ClusterScript Itemにsendするやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sendAll = (items, type, value) => { | |
if (items == null) return; | |
items = items.concat(); | |
while (items.length > 0) { // 送信先があれば実行 | |
const item = items.shift(); // 取り出す | |
try { | |
item.send(type, value); | |
} catch (e) { | |
items.unshift(item); // エラーになったら戻して次回に回す | |
return items; | |
} | |
} | |
return []; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
近くのItemに特定のデータを送るサンプル