"""Fictional BatchPub protocol fixture; unrelated to any real product."""


def flush(pending, published, closed=False):
    if closed:
        return
    for item in pending:
        published.append(item)
    pending.clear()
