Skip to content

Split bindings.rb into per-area files - #1022

Open
coipond-coder[bot] wants to merge 2 commits into
masterfrom
47594-split-bindings
Open

coipond-coder[bot] wants to merge 2 commits into
masterfrom
47594-split-bindings

Conversation

@coipond-coder

@coipond-coder coipond-coder Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Redmine: 47594

Mechanical split of lib/rdkafka/bindings.rb (810 lines) into lib/rdkafka/bindings/*.rb. No behaviour or API change.

  • Every file reopens the same Rdkafka::Bindings module (no submodules). ffi_lib, typedefs and callback constants stay on one module, so Rdkafka::Bindings.rd_kafka_* and the karafka/karafka-core patches (remove_const/const_set on callbacks, external attach_function) keep working.
  • bindings.rb keeps ffi_lib + glibc error, shared constants, SizePtr, rd_kafka_global_init, then require_relatives: structs (all FFI::Structs, loaded first), polling, metadata, messages, configs, list_offsets, errors, configuration, callbacks, handle, consumer, producer, admin, acl.
  • Lines moved verbatim. A sorted-line diff of old vs new shows only the wrapper lines, the require_relatives, and 2 comments (# Stats → # Watermark offsets, new # Messages, topics and topic partition lists header). Moves across sections: the structs into structs.rb, rd_kafka_query_watermark_offsets into list_offsets.rb, rd_kafka_group_result_* into admin.rb.
  • Parity vs master b4ca546 (same machine): 275 singleton methods (names + arities), 117 constants (struct layouts and sizes included), 8 typedefs, 2 enums: identical. spec/lib/rdkafka/bindings_parity_spec.rb pins those 275 methods / 117 constants (additions need no spec change) and checks the 5 callback constants are own constants.
  • .rubocop.yml / .yard-lint.yml: the bindings.rb exclusions also cover lib/rdkafka/bindings/**/*.

Overlap: #1019 adds 3 rd_kafka_message_* bindings and RD_KAFKA_MSG_STATUS_* after rd_kafka_message_timestamp. Whichever merges second moves them into lib/rdkafka/bindings/messages.rb.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

0 participants