You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, state.X methods will check the cabinet for any gateway-received data, and if none is seen, it'll fall back to checking the API and storing the API response into the cabinet.
A major issue with this approach is cache stateless: the stored item is effectively never renewed because Discord never knew to send updates over the (stateless) gateway. Ideally, the state function should let Discord know of this.
Idea
State methods should send a command over to the gateway whenever it can to notify that the returned item should be kept updated. For example, State.Member could do the following:
Specifically for RequestGuildMembersCommand, some debouncing will be required: within duration d (e.g. 250ms), collect all interested member IDs for a guild, assign it a nonce, then try to wait for either a reply for that nonce or for the given context to expire. The state cache will automatically pick up unhandled events and load them into the state cache.
The text was updated successfully, but these errors were encountered:
Background
Currently,
state.X
methods will check the cabinet for any gateway-received data, and if none is seen, it'll fall back to checking the API and storing the API response into the cabinet.A major issue with this approach is cache stateless: the stored item is effectively never renewed because Discord never knew to send updates over the (stateless) gateway. Ideally, the state function should let Discord know of this.
Idea
State methods should send a command over to the gateway whenever it can to notify that the returned item should be kept updated. For example,
State.Member
could do the following:Specifically for
RequestGuildMembersCommand
, some debouncing will be required: within durationd
(e.g.250ms
), collect all interested member IDs for a guild, assign it a nonce, then try to wait for either a reply for that nonce or for the given context to expire. The state cache will automatically pick up unhandled events and load them into the state cache.The text was updated successfully, but these errors were encountered: