Size: a a a

2016 October 08

NK

ID:124915282 in Dev Chat
if i replace chatId with my custom chatId can i wait another id?
источник

NK

ID:124915282 in Dev Chat
i think not
источник

NA

Narek Abovyan in Dev Chat
You cant
источник

NA

Narek Abovyan in Dev Chat
There must be a callback related to that chatId too
источник

NK

ID:124915282 in Dev Chat
yes, because in somewhere another ipc trigger that event
источник

NK

ID:124915282 in Dev Chat
so i have to implement my ipc in higer level
источник

NA

Narek Abovyan in Dev Chat
What are you doing?
источник

NK

ID:124915282 in Dev Chat
ill search if ipc have some timeout for askForNextUpdate
источник

NK

ID:124915282 in Dev Chat
i have to add 2 things
источник

NK

ID:124915282 in Dev Chat
1: timeout on wait
источник

NK

ID:124915282 in Dev Chat
2: wait some other message chat
источник

NK

ID:124915282 in Dev Chat
from another chatId
источник

NK

ID:124915282 in Dev Chat
because if someone do not answer the game will be stuck
источник

NK

ID:124915282 in Dev Chat
you are using node-ipc from npm?
источник

NA

Narek Abovyan in Dev Chat
ID:124915282
2: wait some other message chat
You can do it like this:

$._waitingRequests[chatid here] = your callback
$_waitForUpdate(chatid here)
источник

NA

Narek Abovyan in Dev Chat
ID:124915282
you are using node-ipc from npm?
Nope, I'm not using anything from npm
источник

NK

ID:124915282 in Dev Chat
ill modify method like this:
источник

NK

ID:124915282 in Dev Chat
get waitForRequest(id) {
       return new Promise(resolve => {
           this._waitingRequests[this.chatId] = resolve
           this._waitForUpdate(this.chatId)
       })
   }
источник

NK

ID:124915282 in Dev Chat
sorry i wrong
источник

NK

ID:124915282 in Dev Chat
get waitForRequestid) {
   id = id || this.chatId

       return new Promise(resolve => {
           this._waitingRequests[id] = resolve
           this._waitForUpdate(id)
       })
   }
источник