Skip to content
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 example filter subscription #720

Closed
wants to merge 3 commits into from

Conversation

felipemarts
Copy link
Contributor

I made this example to show how to put an additional filter on pubsub. So each node can verify that the message is valid before sharing it with the other nodes. This helps not to overload the network in cases where the node can check the validity of the messages by itself.

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this example would fit better inside the pubsub examples folder, as the second example

}

//validate fruit
node1.pubsub._pubsub.topicValidators.set(topic, validateFruit);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wemeetagain @jacobheun we should provide a friendly API for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vasco-santos can you open a new issue to discuss the pubsub abstraction we currently have in place here? I think we should look at getting rid of it or finding a cleaner way to support direct access to various modules. The API is unnecessarily restrictive atm.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of course

@felipemarts
Copy link
Contributor Author

Do I place each example as two different folders or two examples in the same folder?

@vasco-santos
Copy link
Member

Do I place each example as two different folders or two examples in the same folder?

I think it should live under the pubsub examples folder. But, let's wait for @jacobheun feedback

@jacobheun
Copy link
Contributor

We can just move it into ./examples/pubsub/filter for now. We can revisit the root readme/example in ./examples/pubsub later (when we revisit external examples and the docs site).

@felipemarts
Copy link
Contributor Author

Done

@jacobheun
Copy link
Contributor

I cleaned up some language and merged this via a331b84. Thanks for the PR!

@jacobheun jacobheun closed this Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants