New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to get the current list of topics #14

Merged
merged 1 commit into from Feb 3, 2019

Conversation

Projects
None yet
2 participants
@tessellator
Copy link
Contributor

tessellator commented Feb 2, 2019

Resolves #13

This commit adds a Topics function to bring the TopicMap
implementation in line with that of the Kafka connector. The Topics
function was added to kafka-connector after the connector-sdk was
extracted from it.

It also adds a Topics function to Controller that returns the list
of topics in the TopicMap. This function is added so that connector
implementations can get the list of current topics without having to
knew about the internal structure of Controller.

Signed-off-by: Chad Taylor taylor.thomas.c@gmail.com

Add functions to get the current list of topics
This commit adds a Topics function to bring the TopicMap
implementation in line with that of the Kafka connector. The Topics
function was added to kafka-connector after the connector-sdk was
extracted from it.

It also adds a Topics function to Controller that returns the list
of topics in the TopicMap. This function is added so that connector
implementations can get the list of current topics without having to
knew about the internal structure of Controller.

Signed-off-by: Chad Taylor <taylor.thomas.c@gmail.com>

@derek derek bot added the new-contributor label Feb 2, 2019

@@ -40,3 +40,15 @@ func (t *TopicMap) Sync(updated *map[string][]string) {

t.lookup = updated
}

func (t *TopicMap) Topics() []string {
t.lock.Lock()

This comment has been minimized.

@alexellis

alexellis Feb 3, 2019

Member

Can we use a RWMutex and RLock?

This comment has been minimized.

@tessellator

tessellator Feb 3, 2019

Author Contributor

Seems reasonable. Let me look into it and get back to you. Thanks!

@alexellis
Copy link
Member

alexellis left a comment

Approved

@alexellis alexellis merged commit 652ebdc into openfaas-incubator:master Feb 3, 2019

@alexellis

This comment has been minimized.

Copy link
Member

alexellis commented Feb 3, 2019

I'll merge the current set of changes and let's convert to RWMutex in the next PR?

@tessellator tessellator deleted the tessellator:add-topics-function branch Feb 3, 2019

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