Skip to content

yigithakverdi/stream-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

A simple script that reads the output of a process and depending on a matched string it does some work, the work is simulated by work() function, it simply simulates it by time.sleep() and at the same time it continues to read the output of the process and writing it into the buffer. There are two different buffers output buffer and archive buffer, output buffer holds the amount of bytes where the match_string will be looked in, if match_string found buffer will be flushed, if not found it will be archived into archive buffer. Archive buffer will be flushed when it reaches the maximum size of the buffer.

Usage

There is no dependency for this project. Just run the streamRead.py as shown below, bare minimum arguments are required to run the script are as follows

python streamRead.py --match_string "ERROR" --process "python3 server.py"

Planned Features

  • Multiple match strings
  • Multiple processes
  • Regex matching

About

A Python console app that reads stream of data "real-time" and according to matched objects does some work

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages