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 the code to handle panic while destroying the pubnub client in case pn.jobQueue is already closed #161

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

piyushkumar96
Copy link

@piyushkumar96 piyushkumar96 commented May 4, 2024

Type of Change

Fixture to handle PubNub Client Destroy Gracefully in case JobQueue is already closed(non-breaking changes which adds functionality)

Description

Problem

  • I was implementing the reinitialize pubnub client mechanism in my application, So before reinitializing it, I was calling the inbuilt Destroy() func for cleaning all open requests, removing listeners, etc. It was throwing panic with the error mentioned below

  • Code In which it was panicking
    p.client.Destroy()
    lib code snapshot
    image
    panic Error
    image

Solution

  • Added the condition to check if it is already closed or not before closing it

Tested

  • Tested locally
    I was able to destroy the client connection gracefully and reinitialize the client connection in case of any pubnub system status events
    image

@piyushkumar96
Copy link
Author

Hi @marcin-cebo @Xavrax @seba-aln
Can anyone one of you please review this PR, Please let me know if you need anything else from me, feel free to reach out to me.
Thanks & Regards,
Piyush

@piyushkumar96
Copy link
Author

Hi @marcin-cebo @Xavrax @seba-aln
Still waiting to get this PR review by you, Could you guys please review it.
Please let me know if you need anything else from me, feel free to reach out to me.
Thanks & Regards,
Piyush

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.

2 participants