These are chat archives for cherrypy/cherrypy

12th
Jan 2017
ingoogni
@ingoogni
Jan 12 2017 12:25
Posted a question to the mailing list a few days ago. Would like some input on it as i'm just strating with this and an rather confused. Thanks
Sviatoslav Sydorenko
@webknjaz
Jan 12 2017 15:11
ingoogni
@ingoogni
Jan 12 2017 17:28
@webknjaz Thanks, I'm aware of the sources. Implemented @jaraco suggestion in the mailinglist :( lots of errors in the browsers and missing data. Getting data from the outside is rock solid
def generator():
while True:
yield "event: time\n" + "data: " + str(psutil.cpu_percent(2))+ "\n\n"
return generator()
I'll try more after the weekend ,
Sviatoslav Sydorenko
@webknjaz
Jan 12 2017 21:23
@ingoogni Please try formatting code snippets with tripple backticks to make it more readable :) Do you return inside of generator or outside?
Also, I'm not aware (not following) the mailing list you mentioned. Please share a link to provide better context on your question.
ingoogni
@ingoogni
Jan 12 2017 23:42
Thinking about it, could use a full blown observer pattern or just a class with a setter 'outside' cherrypy. GAve it a quick try it with the setter but that gets me still lots of errors, probably not done threadsafe....?
Could probably also use that way to push data from the bus to a publishing method. I'll try tomorrow.
What's the preferred place to discuss, here or there?