Skip to content

Use long-polling for bot connections to wait for work

Adam Coldrick requested to merge sotk/smart-bot-calls into master

Description

This is a reworked version of !113 (closed), updated to account for the various things that have changed since then. It would probably be useful to test this more thoroughly before it is merged, and also consider if the increased thread usage is worth the utility of this now, or if we should look at using asyncio rather than threads first.

Changes proposed in this merge request:

  • Change queue structure from a list to PriorityQueue to allow bots to wait for jobs if none are immediately available.
  • Have bots specify a timeout in the grpc call, and have the servers check this.
  • Get bots to reconnect.
  • Update the test suite (this was previously "Add some tests", but there are not really any simple tests that need adding).
  • Refuse requests that don't fit in the thread pool now that it is more heavily used.
  • Have bots polling at different rates depending on what they're doing, to allow faster cancellation.

This merge request, when merged, will address issue/bug:

#118 (closed)

Edited by Adam Coldrick

Merge request reports