Skip to content

Iterator based API is very constraining #86

Description

@dpc

I need to take djot content, and replace certain types of links (to usernames) with other content (their display names).

To do that when I spot a certain event, of a certain format, I need to use it to look up user's information in the database. I can't do that in a .map(...) of an iterator, because I'm using async API.

I thought I could just use for event in events, but looks like the renderer expects a single iterator.

IMO, avoiding constraining API to iterator would work better here. A Renderer could have individual events pushed to it, and then the render_epilogue (fn finish might be a better name) could be called manually by the user. This would avoid async issues too. Iterator methods could be helpers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions