Browse Source

Add StreamInserter.send() to trigger intermediate block send

tags/nilmdb-1.4.6
Jim Paris 11 years ago
parent
commit
26bab031bd
2 changed files with 6 additions and 0 deletions
  1. +5
    -0
      nilmdb/client/client.py
  2. +1
    -0
      tests/test_client.py

+ 5
- 0
nilmdb/client/client.py View File

@@ -313,6 +313,11 @@ class StreamInserter(object):
part of a new interval and there may be a gap left in-between."""
self._send_block(final = True)

def send(self):
"""Send any data that we might have buffered up. Does not affect
any other treatment of timestamps or endpoints."""
self._send_block(final = False)

def _get_first_noncomment(self, block):
"""Return the (start, end) indices of the first full line in
block that isn't a comment, or raise IndexError if


+ 1
- 0
tests/test_client.py View File

@@ -460,6 +460,7 @@ class TestClient(object):
ctx.update_start(109)
ctx.insert("110 1\n")
ctx.insert("111 1\n")
ctx.send()
ctx.insert("112 1\n")
ctx.insert("113 1\n")
ctx.insert("114 1\n")


Loading…
Cancel
Save