ReadyState
Attributes
WeakReferer
to Client
Reference to the ready state's client.
int
The amount of shards of the client.
None
of Future
Waiter for shard ready event.
User requester for each shard.
Task, which waits for all the user requests to finish.
Methods
(client)
__new__Creates a new ready state instance from the given parameters.
Parameter | Type | Description |
---|---|---|
client | The respective client instance. |
()
call_readyCalls the ready event handler of the respective client.
()
cancelCancels the ready state.
(guild)
discard_guildDiscards a guild from the guild requests.
Parameter | Type | Description |
---|---|---|
guild | The guild to discard from the ready state. |
(client, guild)
feed_guildFeeds the given guild
to the ready state. Sets the last received guild's time to the current time and ends the ready state if there are no more guilds to receive.
Parameter | Type | Description |
---|---|---|
client | The respective client instance. | |
guild | Received guild. |
Returns
request_enqueued : bool
Whether the request is queued up.
(guild_datas, shard_id)
shard_readySets the ready state's .last_ready
to the current time and increases it's .guild_left_counter
by the length of the given data.
Parameter | Type | Description |
---|---|---|
guild_datas |
| Received guild datas. |
shard_id |
| The shard's identifier. |
()
_runnerRunner task of the ready state waiting for all guild users to be requested.
This method is a coroutine.
()
__await__Waits till the ready state receives all of it's shards and guilds, or till timeout occurs.
This method is an awaitable generator.
()
__iter__Waits till the ready state receives all of it's shards and guilds, or till timeout occurs.
This method is an awaitable generator.