From f0b019ed694e74fd1f90ea96b2e4c95405e07efc Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Mon, 27 Oct 2014 09:42:01 -0700 Subject: [PATCH] Update the C provider to accept a topic into the consume method Note: this doesn't actually do anything just yet --- ext/hermann/hermann_lib.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ext/hermann/hermann_lib.c b/ext/hermann/hermann_lib.c index 69a40c8..f906ec6 100644 --- a/ext/hermann/hermann_lib.c +++ b/ext/hermann/hermann_lib.c @@ -379,13 +379,12 @@ void consumer_consume_loop(HermannInstanceConfig* consumerConfig) { } /** - * Hermann::Consumer.consume - * - * Begin listening on the configured topic for messages. msg_consume will be called on each message received. + * Hermann::Lib::Consumer.consume * * @param VALUE self the Ruby object for this consumer + * @param VALUE topic the Ruby string representing a topic to consume */ -static VALUE consumer_consume(VALUE self) { +static VALUE consumer_consume(VALUE self, VALUE topic) { HermannInstanceConfig* consumerConfig; @@ -1012,7 +1011,7 @@ void Init_hermann_lib() { rb_define_method(c_consumer, "initialize_copy", consumer_init_copy, 1); /* Consumer has method 'consume' */ - rb_define_method( c_consumer, "consume", consumer_consume, 0 ); + rb_define_method( c_consumer, "consume", consumer_consume, 1); /* ---- Define the producer class ---- */ c_producer = rb_define_class_under(lib_module, "Producer", rb_cObject);