Skip to content

Conversation

@TylerWitt
Copy link
Contributor

There are a lot of places in the docs where we were explaining the return typing and input for the handle_messages/1 callback from kafka consumption.

This behaviour module

  1. Lets the documentation be centralized
  2. Lets us define a @spec so library consumers get better warnings

This fixes some hex formatting, removes outdated documentation, and fixes what I think is the last of the duplicated `@doc` warnings
This should make implementation easier, and also makes the contract a little more clear. It will also give better warnings in implementing code if (as an example) the wrong return type is possible.
Copilot AI review requested due to automatic review settings August 5, 2025 17:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new Kaffe.MessageHandler behaviour module to centralize documentation and provide better type specs for Kafka message handling. The change improves developer experience by consolidating scattered documentation and enabling better compiler warnings for library consumers.

  • Adds Kaffe.MessageHandler behaviour with centralized documentation and type specs
  • Updates documentation to reference the new behaviour instead of inline explanations
  • Reorganizes documentation in producer module by moving inline docs to function definitions

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
mix.exs Bumps version to 1.28.0 and adds CHANGELOG.md to documentation
lib/kaffe/message_handler.ex New behaviour module defining handle_messages/1 callback with comprehensive documentation
lib/kaffe/consumer_group/worker/worker.ex Updates worker documentation to reference new MessageHandler behaviour
lib/kaffe/consumer.ex Adds message() type definition for better type safety
lib/kaffe/producer.ex Refactors documentation by moving inline docs to function definitions
README.md Updates usage examples to show MessageHandler behaviour implementation
CHANGELOG.md Documents the new feature in version 1.28.0

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.

2 participants