in tbapi/__init__.py [0:0]
def tryExecuteQuery(self, query: str, options: SelectionOptions = None, timestamp: int = JAVA_LONG_MIN_VALUE, entities: 'list[str]' = None, params: 'list[QueryParameter]' = []) -> 'TickCursor':
'''Contextmanager version of executeQuery. Usage:
```
with db.newExecuteQuery('select * from stream') as cursor:
while cursor.next():
message = cursor.getMessage()
```
'''
cursor = None
try:
if options == None:
cursor = self.__executeQuery(query)
else:
cursor = self.__executeQueryFull(query, options, timestamp, entities, params);
yield cursor
finally:
cursor.close()