Skip to content
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

Make find_offers() an Executor method; handle offer proposals concurrently #306

Merged
merged 4 commits into from
Apr 14, 2021

Conversation

azawlocki
Copy link
Contributor

@azawlocki azawlocki commented Mar 31, 2021

Resolves #304

Changes:

  • find_offers(), previously an inner coroutine defined in Executor._submit(), is made a method of Executor.
  • A new transitional class Executor.SubmissionState that gathers some pieces of data related to a single call to Executor.submit() is added; for now it includes the parts required by find_offers().
  • Processing of offer proposals is done concurrently, for each proposal a new asyncio task is spawned by find_offers(); the number of tasks is limited (currently 5), if this number is reached, a new proposal must wait until a slot becomes available.
  • Related to yapapi is not picking up offers from market sometimes #304: 5 sec request timeouts are added to Subscription.respond() and .reject() methods in the market API.

iter(common_platforms)
)
else:
# reject proposal if there are no common payment platforms
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like there could be a _reject_proposal(proposal, reason) method to handle the proposal rejections...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 22be8cd

Copy link
Contributor

@shadeofblue shadeofblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all-ok-here-29195232

@azawlocki azawlocki force-pushed the az/refactor-find-offers branch from 5c5cdf4 to fa1c1a9 Compare April 14, 2021 15:28
@azawlocki azawlocki merged commit a3ef45c into master Apr 14, 2021
@azawlocki azawlocki deleted the az/refactor-find-offers branch April 14, 2021 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yapapi is not picking up offers from market sometimes
2 participants