Hi !

Another issue I have to deal with is the polling (update_meta() 
function) should not happen place until the stream connection is not 
established or under error.

First case I think of:

x = insert_metadata(s0)
insert = fst(x)
s = snd(x)

delay = ref 5. #default poll interval

output = out(on_disconnect={ delay := (-1.) }, on_connect={ delay := 
(5.) } ...... , s) # I could add on_error here too

def update_meta() =
     path = get_source(output) # I need the source "output" here
     (...)
     !delay
end

add_timeout(0.; update_meta)

Pro's: polling is stopped when needed.
Problem:
-  I can't start the poll anymore when the connection comes up gain. 
(on_connect with new positive delay is useless as add_timeout stopped).

Note:  on_disconnect is not called on initial connection failure. 
("disconnect" implied by "connection had success before"). So I solved 
that by defining on_error but the first problem remains.

So I've think to put add_timeout() call directly in on_connect 
definition but it's not possible as update_meta() can't be defined 
before output source.

What do you think I could do ?

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to