Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARXIVNG-281 introduced base class and tools for Kinesis consumers #49

Merged
merged 2 commits into from
Apr 23, 2018

Conversation

erickpeirson
Copy link
Contributor

(from docs in PR)

We use Kinesis streams to broker notifications that concern multiple services
in the arXiv system. For example, at publication time, the publication process
generates notifications about new arXiv papers so that services like search
can update themselves.

This module provides a base class for building agents with Kinesis streams,
:class:.BaseConsumer. The objective is to provide all of the
stream-management (e.g. checkpointing) and error-handling boilerplate needed
for any Kinesis consumer, so that we can focus on building the idiosyncratic
functional bits in arXiv services.

You (the developer) should be able to create a minimal agent by:

  1. Defining a class that inherits from :class:.BaseConsumer
  2. Defining an instace method on that class with the signature:
    def process_record(self, record: dict) -> None: that implements
    application-specific processing for each notification.
  3. Calling :func:.process_stream with your consumer class and an application
    config (e.g. from Flask).

Copy link
Contributor

@mhl10 mhl10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. This will be a helpful addition to arxiv-base!

@erickpeirson erickpeirson merged commit 9f2eb52 into develop Apr 23, 2018
@JaimieMurdock
Copy link
Contributor

Thanks for the documentation as well!

@erickpeirson erickpeirson deleted the task/ARXIVNG-281 branch August 17, 2018 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants