class_docstr: Stream data from a text file
  
  Parameters
  ----------
  f: file or string
      Source of the data. If string, will be opened.
  poll_interval: Number
      Interval to poll file for new data in seconds
  delimiter: str
      Character(s) to use to split the data into parts
  start: bool
      Whether to start running immediately; otherwise call stream.start()
      explicitly.
  from_end: bool
      Whether to begin streaming from the end of the file (i.e., only emit
      lines appended after the stream starts).
  
  Examples
  --------
  >>> source = Stream.from_textfile('myfile.json')  # doctest: +SKIP
  >>> source.map(json.loads).pluck('value').sum().sink(print)  # doctest: +SKIP
  >>> source.start()  # doctest: +SKIP
  
  Returns
  -------
  Stream
class_docstr_tok: ["Stream","data","from","a","text","file","Parameters","--","--","--","--","--","f",":","file","or","string","Source","of","the","data",".","If","string",",","will","be","opened",".","poll_interval",":","Number","Interval","to","poll","file","for","new","data","in","seconds","delimiter",":","str","Character","(","s",")","to","use","to","split","the","data","into","parts","start",":","bool","Whether","to","start","running","immediately",";","otherwise","call","stream.start","(",")","explicitly",".","from_end",":","bool","Whether","to","begin","streaming","from","the","end","of","the","file","(","i.e.",",","only","emit","lines","appended","after","the","stream","starts",")",".","Examples","--","--","--","--",">",">",">","source","=","Stream.from_textfile","(","'myfile.json","'",")","#","doctest",":","+SKIP",">",">",">","source.map","(","json.loads",")",".pluck","(","'value","'",")",".sum","(",")",".sink","(","print",")","#","doctest",":","+SKIP",">",">",">","source.start","(",")","#","doctest",":","+SKIP","Returns","--","--","--","-","Stream"]
code: def __init__(
      self,
      f,
      poll_interval=0.100,
      delimiter="\n",
      from_end=False,
      **kwargs,
  ):
      if isinstance(f, str):
          f = open(f)
      self.buffer = ""
      self.file = f
      self.from_end = from_end
      if self.from_end:
          # this only happens when we are ready to read
          self.file.seek(0, 2)
      self.delimiter = delimiter
  
      self.poll_interval = poll_interval
      super().__init__(**kwargs)
  
imports: import asyncio
  from glob import glob
  import queue
  import os
  import time
  from tornado import gen
  import weakref
  from .core import Stream, convert_interval, RefCounter, sync
label_desc: Use image node_id 1 to create a new from_textfile object from inherited base classes: Source with example: obj = from_textfile(f, poll_interval, delimiter, from_end)