-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2.0.0 rest refactor #69
Merged
Merged
Conversation
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
… to be more adaptable
…and add wakeup for io_poller
…; rename idle_contexts to queues->recycling and add queues->completed
* wip(discord-rest): move bucket's pthread_cond_t to individual 'struct discord_context' * fix(discord-rest_async.c): move io_poller_wakeup() back to discord_async_start_context()
…cks from the main thread
… thread, modularize and split functions
to their appropriate 'discord-rest' module * fix(discord-rest): race-conditions from cleanup ordering
discord-rest_request.c * refactor(discord-rest_request): rename 'struct discord_async' -> 'struct discord_requestor', 'struct discord_request' -> 'struct discord_request', 'struct discord_context' -> 'struct discord_request' * refactor(discord-rest_request): move every discord-rest.c logic that handles any of the discord-rest_request.c structures
…' to 'struct discord_rest'
…of 1sec enforced delay block, add wakeup to main thread's poll
…ontains() private
…and separate threads
…mutexes, no longer needed since its only run at the REST thread
…ue has been moved
…ing the client to truly idle
…nselect() to iterate only over buckets that have pending requests
Closed
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Why?
1.1. Asynchronous requests logic would get entangled with Discord's Gateway loop, meaning performing asynchronous requests were only be possible while
discord_run()
is performing.1.2. Use the same implementation for both
asynchronous
andsynchronous
requests - rather than having repetitive code for handling each mode individually.How?
threadpool.h
to start a single REST manager thread.Testing?
test/racecond.c
bot spamming.Anything Else?
This PR will make implementing a solution for #35 far more trivial, considering there is no longer a dependency on the Discord's Gateway running.