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

Added signal handling to prevent new subscriptions #189

Merged
merged 1 commit into from
Nov 1, 2021
Merged

Added signal handling to prevent new subscriptions #189

merged 1 commit into from
Nov 1, 2021

Conversation

bmuddha
Copy link
Contributor

@bmuddha bmuddha commented Nov 1, 2021

Signal handler listens for USR1 signal and upon receiving one, toggles
the switch in PubSub manager. In true state the pubsub manager will
allow unlimited number of new subscriptions, in false state no new
subscriptions can be created, and thus only the present ones will
continue to exist, until they are too removed due to TTL.

@bmuddha bmuddha changed the title Added optional paramter to control the number of ws subscriptions Added optional parameter to control the number of ws subscriptions Nov 1, 2021
@bmuddha bmuddha requested a review from 00nktk November 1, 2021 06:35
@polachok
Copy link
Collaborator

polachok commented Nov 1, 2021

I was thinking more of a boolean flag to check against, it doesn't seem generally useful to limit number of subscriptions to some arbitrary number.
@00nktk what do you think?

@00nktk
Copy link
Collaborator

00nktk commented Nov 1, 2021

I was thinking more of a boolean flag to check against, it doesn't seem generally useful to limit number of subscriptions to some arbitrary number.
@00nktk what do you think?

A flag seems like a feature less likely to be misused, but I think it's better to ask someone who's planning to use this.

@bmuddha bmuddha changed the title Added optional parameter to control the number of ws subscriptions Added signal handling to prevent new subscriptions Nov 1, 2021
@bmuddha
Copy link
Contributor Author

bmuddha commented Nov 1, 2021

Rewrote this feature via flag usage, it's set to true on application startup and can be toggled via USR1 signal.

src/pubsub.rs Outdated Show resolved Hide resolved
src/rpc.rs Outdated Show resolved Hide resolved
Signal handler listens for USR1 signal and upon receiving one, toggles
the switch in PubSub manager. In true state the pubsub manager will
allow unlimited number of new subscriptions, in false state no new
subscriptions can be created, and thus only the present ones will
continue to exist, until they are too removed due to TTL.
@bmuddha bmuddha merged commit 0c3a184 into bestarch-ae:master Nov 1, 2021
@bmuddha bmuddha deleted the ws-sub-limit branch November 10, 2021 12:47
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