Skip to content

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

Merged
azawlocki merged 4 commits intomasterfrom
az/refactor-find-offers
Apr 14, 2021
Merged

Make find_offers() an Executor method; handle offer proposals concurrently#306
azawlocki merged 4 commits intomasterfrom
az/refactor-find-offers

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