Streaming help with dazl

  1. .stream() takes an offset parameter, so you can simply pass that:

    async with conn.stream(offset="...") as stream:
        async for event in stream.creates():
            ...
    

    But because you’d need to also get offsets, you’d need to use a slightly different API:

    async with conn.stream(offset="...") as stream:
        async for event in stream:
            if isinstance(event, CreateEvent):
                ...
            elif isinstance(event, Boundary):
                # remember this offset somehow
                ... = event.offset
    
  2. Both are supported; use whichever style you prefer. (I personally don’t use the callback style any more.)

  3. Not sure I understand the question…is this simply a repeat of 1?