Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

WIP: send multiple queries in single request #170

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

klahnakoski
Copy link
Contributor

@klahnakoski klahnakoski commented Jun 19, 2020

ActiveData will soon be accepting {"tuple":[]} requests, which accepts a list of of disparate queries. The hope is multithreading the disparate queries on the server side will be a little faster in aggregate, especially if the queries hit the same columns.

Comment on lines +33 to +42
def extend(cls):
"""
DECORATOR TO ADD METHODS TO CLASSES
:param cls: THE CLASS TO ADD THE METHOD TO
:return:
"""
def extender(func):
setattr(cls, func.__name__, func)
return func
return extender
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tell me where to put this (or if you want me to inline it)

Comment on lines +45 to +57
@extend(Queue)
def get_all(self):
"""
Get all in queue, without waiting
:param self:
:return: list of queue items
"""
acc = []
while True:
try:
acc.append(self.get(block=False))
except Empty:
return acc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tell me where you would like this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant