Hi,
how can I reply to the sending endpoint not using return as I want to keep the connection open?
My endpoint works as long as I respond via the return through the appserver but I do not want to close the connection. I tried using yield with json.dumps but then the appserver throws a serialization error.
Doing this async it also something the appserver does not like.
How can I do something like:
response {'a':'1'}
... do something
return {'a':'2'}
Sample, this works:
Hi @Schroeder
In your restmap.conf have you set stream=true? I'm not sure if this is the only thing you would need to change but it could be a good starting point!
stream = <boolean>
* Describes whether or not splunkd sends the payload in the
request to the driver in a streaming fashion.
* A value of "true" means splunkd sends the payload in the
request to the driver in a stream, or multiple sequential requests.
* A value of "false" means splunkd sends the payload in the
request to the driver as a field of the original request.
* Only has effect if the 'scripttype' setting is set to "persist".
* Default: false
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing
Hi!
No, I did not. Does that mean I could then use yield?
I have a hard way to find good examples for me use case.
//Peter
Hi @Schroeder
I've been trying to get this to work but unfortunately not managed to. It looks like this is designed for streamed payload being sent into the persistconn/appserver.py rather than as a response to the browser.
Please let us know if you do manage to get anywhere with this though - Perhaps its possible with a custom driver = value, although there arent many examples of this online!
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing