Class: Rdkafka::Callbacks::CreateAclHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- Rdkafka::Callbacks::CreateAclHandler
- Defined in:
- lib/rdkafka/callbacks/create_acl_handler.rb
Overview
Handles RD_KAFKA_EVENT_CREATEACLS_RESULT events
Class Method Summary collapse
-
.call(event_ptr) ⇒ void
Resolves the create-ACL handle from its result event.
Class Method Details
.call(event_ptr) ⇒ void
This method returns an undefined value.
Resolves the create-ACL handle from its result event
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rdkafka/callbacks/create_acl_handler.rb', line 12 def call(event_ptr) create_acls_result = Rdkafka::Bindings.rd_kafka_event_CreateAcls_result(event_ptr) # Get the number of acl results pointer_to_size_t = FFI::MemoryPointer.new(:size_t) create_acl_result_array = Rdkafka::Bindings.rd_kafka_CreateAcls_result_acls(create_acls_result, pointer_to_size_t) create_acl_results = CreateAclResult.create_acl_results_from_array(pointer_to_size_t.read_int, create_acl_result_array) create_acl_handle_ptr = Rdkafka::Bindings.rd_kafka_event_opaque(event_ptr) if create_acl_handle = Rdkafka::Admin::CreateAclHandle.remove(create_acl_handle_ptr.address) unless resolve_operation_error(event_ptr, create_acl_handle) create_acl_handle[:response] = create_acl_results[0].result_error create_acl_handle.result = Rdkafka::Admin::CreateAclReport.new( rdkafka_response: create_acl_results[0].result_error, rdkafka_response_string: create_acl_results[0].error_string ) create_acl_handle. = create_acl_handle.result.rdkafka_response_string create_acl_handle.unlock end end end |