Read from input periodically #2314
Replies: 2 comments 5 replies
-
Hey @sagikazarmark, can you offer some more details about what you're trying to achieve? It's not clear why the
Are you asking about building a custom input plugin? LE: See below for details about back pressure and throttling. |
Beta Was this translation helpful? Give feedback.
-
Thank you @mihaitodor and @Jeffail for your answers! I created the aforementioned One issue I've recently experienced though is with inputs like
What I'm trying to do now is add an option to I realize this is probably dangerous, but in this particular case, where I know there is an end, I think it should be okay. WDYT? I also found #2301 which is somewhat similar and @Jeffail suggested a similar input implementation. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to read from an input (let's say HTTP endpoint) periodically (meaning I want to essentially re-read a list of items every X seconds).
The closest thing I found to a periodic input is the
generate
input, but it doesn't fit this use case well (although the documentation mentions it could be used with an HTTP processor).The idea I'm working on right now is a
schedule
input (based on thegenerate
input) that would essentially block for the interval (using a timer) and would read from a child input.I don't actually need batching in this case, I just want to read all, so I'll omit the batching configuration.
First of all: is this a good idea? (I was kinda surprised there is no such input in benthos which made me doubt if I'm on the right path)
I found #580, but I don't see too much activity on it lately.
Secondly, I'm not really sure about the semantics of
ReadBatch
: in my case, it would block on a timer and then return a set of messages. WouldReadBatch
immediately be called again? (Otherwise the timer is kinda pointless/unreliable).(I could run Benthos as a cron job, but this service would run in Kubernetes and I don't trust it entirely, especially when it's run at low (5-10 second) intervals)
Any insights are greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions