-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Octopoller - here to solve all your polling needs #1039
Comments
I drafted up a ruby gem repo for you two to look at: |
@BenEmdon thanks so much for this! I chatted with @tarebyte about this and we have a few thoughts. We think that the behavior is very useful, and should be made available to folks using octokit. The current project that I'm working on in the GitHub REST API, is going to allow us to do a bunch of code generation in this gem. As part of that we're going to want to take a step back and think about the overall architecture of the gem. Since we have a few things up in the air right now, we don't want to add octopoller to octokit.rb directly, just yet, though we think that is what should happen once we get our duckies in a row. How would you feel about the following:
You would remain the main maintainer on the octopoller gem, but for redundancy, we'd probably want to add both me and tarebyte to the repo, and give us both the ability to cut new releases and publish them to rubygems. |
@kytrinyx @tarebyte thanks for considering Octopoller. I feel very good with adding the gem to the Octokit org and renaming it to octopoller.rb! I have some question about how we should move forward:
|
Sure does, you have an invite in your inbox 馃槃
Probably it's own section talking about when polling would be useful and using the gem as an example with a link.
I think the current naming is fine. |
I tried to transfer ownership of octopoller.rb to the octokit org but I was met with this error message:
@tarebyte how should I transfer ownership? |
It looks like this is sorted, but for the future: you can only transfer to (a) another user, or (b) an org you are admin of. My standard approach is to transfer to a user who is an admin, who then transfers it on to the org :) |
Since octopoller.rb is already under the management of octokit I think we are good to close this proposal 馃帀 |
Octopoller 馃
This is a proposal to add Octopoller to octokit.
Feedback/ideas would be appreciated 馃槃
The code for Octopoller can be found in education/classroom at: https://github.com/education/classroom/blob/master/lib/octopoller.rb
What is Octopoller
I created Octopoller, a polling micro module for education/classroom to make repeating requests to the GitHub API. After adding it to classroom @tarebyte said in a review education/classroom#1375 (comment):
After refining Octopoller since that initial PR I feel its ready to move over to octokit. Either inside octokit.rb or as a tiny gem under the octokit org.
What was Octopoller used for
Octopoller was created for the purpose of polling the Source Imports API for a repo's import status. Octopoller is now the backbone of classrooms import starter code process.
Show me the code
Octopoller exposes a single function
poll
. Here is what what the API looks like:Using it might look like this:
Usage
Octopoller has 3 use cases:
Here's what using Octpoller is like for each of the use cases listed above:
Poll with a timeout:
Poll with retries:
Poll with exponential backoff:
What benefit is this to the repo/org?
Octopoller is perfect for developers who need to poll an endpoint or attempt a something a set number of times until success. Octopoller is also unopinionated such that any ruby developer could use this.
Maintainability and work
Octopoller is a micro module and will change very little. I am happy to do all the work to write documentation (and possibly publish as a ruby gem).
The text was updated successfully, but these errors were encountered: