Skip to content

core: simplify the pull API #47

Closed

Description

@CameronBrooks11

The pull path has layers left over from before batched fetching (0.2.0):

  • Pull(titles, fetch FetchFunc, root, host, path, force) fetches one title at a time through a callback. Its only caller is PullSet, which has already fetched everything in batches and wraps the result map back into a callback that never returns an error. So Pull's error path for a failed fetch can't happen.
  • PullSet(sel, list, fetch, root, host, path, force) takes 7 positional arguments, and main passes the same client twice (client, client.FetchPages).
  • The host and path travel as two strings everywhere (ResolveWiki returns them, Pull and PullSet take them).

Fix: Pull takes the fetched pages instead of a callback; Lister gains FetchPages, so PullSet takes one wiki value. Host and path become one Wiki value. No change to behaviour or output.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions