rticonnextdds-connector-go icon indicating copy to clipboard operation
rticonnextdds-connector-go copied to clipboard

Get/Wait for matched messages

Open metarsit opened this issue 5 years ago • 5 comments

Proposal:

The latest Connector introduced new functions including:

  • RTI_Connector_wait_for_matched_publication
  • RTI_Connector_wait_for_matched_subscription
  • RTI_Connector_get_matched_subscriptions
  • RTI_Connector_get_matched_publications

Current behavior:

No support on the listed functions

Desired behavior:

Support the listed functions

Use case:

  • Wait for matched publication/subscription
  • Get matched publication/subscription

metarsit avatar Nov 05 '20 04:11 metarsit

@kyoungho I will pick up these 4, please assign to me.

metarsit avatar Nov 05 '20 04:11 metarsit

Should these go to master or develop?

metarsit avatar Nov 05 '20 04:11 metarsit

@metarsit I assigned it to you. I made develop as the default branch, so it can go to develop. Thanks!

kyoungho avatar Nov 05 '20 04:11 kyoungho

@kyoungho I am looking to implement this but I think I need some help from you..

So for example, this function:

int RTI_Connector_wait_for_matched_publication(
	void *reader,
	int ms_timeout,
	int *current_count_change);

What is the *reader and what is *current_count_change?

My guess is something like this?

func (instance *Instance) WaitForMatchedPublication(timeout time.Duration) error {
	var count C.int // Probably a channel?
	retcode := int(C.RTI_Connector_wait_for_matched_publication(
		unsafe.Pointer(instance.output), C.int(timeout.Milliseconds()), &count),
	)
	return checkRetcode(retcode)
}

And is there a document I can read up a little more about these functions?

metarsit avatar Nov 08 '20 06:11 metarsit

@metarsit The following Python Connector documentation/code would help you to understand how it works.

https://community.rti.com/static/documentation/connector/current/api/python/input.html#matching-with-a-publication

https://github.com/rticommunity/rticonnextdds-connector-py/blob/master/rticonnextdds_connector/rticonnextdds_connector.py#L829

kyoungho avatar Nov 08 '20 21:11 kyoungho

Completed

https://github.com/rticommunity/rticonnextdds-connector-go/commit/343331f95fb1f3c5b228e050e6c30e6d165e2fcb

kyoungho avatar May 19 '23 15:05 kyoungho