You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
The getTopic(name, options) method does two things as of now:
Create a topic (with the given options) when its called the first time (i.e., when the topic does not exist)
Use the existing topic (and discard the options) when its called subsequently (i.e., when the topic exist)
This is fine when you know the flow of execution, but when you don't you don't know which call creates a topic and which one just gets, you kind of have to make sure that all your calls to getTopic should contain the same options (because you want to ensure that wherever the topic is created, it should have the same options)
Since persisted is the only option, I was thinking if we should add a getPersistentTopic(name) method that does the following:
If there is no any topic with given name present, create a new one with persistence
if the topic is persistent return it
Throw an error saying the topic is not persistent
Or maybe something flexible like: getPersistentTopic(name, coerce=false)
If there is no any topic with given name present, create a new one with persistence
if the topic is persistent return it
If coerce is true convert the existing topic to persistent and return it
Throw an error saying the topic is not persistent and coerce was passed false.
The text was updated successfully, but these errors were encountered:
nootanghimire
changed the title
Add getPeristentTopic method
Add getPersistentTopic method
Nov 12, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The
getTopic(name, options)
method does two things as of now:This is fine when you know the flow of execution, but when you don't you don't know which call creates a topic and which one just gets, you kind of have to make sure that all your calls to
getTopic
should contain the same options (because you want to ensure that wherever the topic is created, it should have the same options)Since persisted is the only option, I was thinking if we should add a
getPersistentTopic(name)
method that does the following:Or maybe something flexible like:
getPersistentTopic(name, coerce=false)
The text was updated successfully, but these errors were encountered: