# HG changeset patch # User drewp@bigasterisk.com # Date 1480125386 28800 # Node ID 02d9915b3bbbfad1b51c4d1479f11495ba46ac2e # Parent 8db492695a51a058adac4689ac9dc29d941e292f patchsource accept much longer lines from sse_collector Ignore-this: 712d52cecf99c82afffc1ab6b58a5b4f diff -r 8db492695a51 -r 02d9915b3bbb service/reasoning/sse_collector.py --- a/service/reasoning/sse_collector.py Wed Oct 12 18:37:41 2016 -0700 +++ b/service/reasoning/sse_collector.py Fri Nov 25 17:56:26 2016 -0800 @@ -274,6 +274,10 @@ p = self.statements.makeSyncPatch(h, self._sourcesForHandler(h)) if not p.isNoop(): log.debug("send patch %s to %s", p.shortSummary(), h) + # This can be a giant line, which was a problem once. Might be + # nice for this service to try to break it up into multiple sends, + # although there's no guarantee at all since any single stmt + # could be any length. h.sendEvent(message=jsonFromPatch(p), event='patch') def addSseHandler(self, handler): diff -r 8db492695a51 -r 02d9915b3bbb service/reasoning/twisted_sse_demo/sse_client.py --- a/service/reasoning/twisted_sse_demo/sse_client.py Wed Oct 12 18:37:41 2016 -0700 +++ b/service/reasoning/twisted_sse_demo/sse_client.py Fri Nov 25 17:56:26 2016 -0800 @@ -3,12 +3,17 @@ class EventSourceProtocol(LineReceiver): def __init__(self): + self.MAX_LENGTH = 16384 * 8 self.callbacks = {} self.finished = None # Initialize the event and data buffers self.event = 'message' self.data = '' + def lineLengthExceeded(self, line): + print "line too long" + raise NotImplementedError + def setFinishedDeferred(self, d): self.finished = d