in tbapi/__init__.py [0:0]
def tryCursor(self, options: SelectionOptions) -> 'TickCursor':
'''contextmanager version of createCursor. Usage:
```
with stream.newCursor(options) as cursor:
while cursor.next():
message = cursor.getMessage()
```
'''
cursor = None
try:
cursor = self.__createCursor(options)
yield cursor
finally:
cursor.close()