stream.py 450 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
from taos.cinterface import *
from taos.error import *
from taos.result import *


class TaosStream(object):
    """TDengine Stream interface"""

    def __init__(self, stream):
        self._raw = stream

    def as_ptr(self):
        return self._raw

    def close(self):
        """Close stmt."""
        if self._raw is not None:
            taos_close_stream(self._raw)
            self._raw = None

    def __del__(self):
        self.close()