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

stop method #34

Closed
was1l1sk opened this issue Sep 12, 2018 · 5 comments
Closed

stop method #34

was1l1sk opened this issue Sep 12, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@was1l1sk
Copy link

great work
I did not find any method for stopping connection and running gorutins like:
go wac.readPump ()
go wac.writePump ()
go wac.keepAlive (20000, 90000)
I just wrapped the bot in the web interface that the bot activates. And I want to turn it off without closing the whole application. I wanted to close using the context.WithCancel but this is not enough

And... Does whatsapp ban a bots?

@SchulteMK
Copy link
Collaborator

We need to implement a way to stop these goroutines. Maybe check out the fork of @kaxap. He improved on it if I remember correctly.

@SchulteMK
Copy link
Collaborator

@was1l1sk Maybe you can implement the context package into the api and start a PR if you have spare time.

@kaxap
Copy link
Contributor

kaxap commented Oct 2, 2018

@SchulteMK I had the same issue as @was1l1sk so I made this quick hack. The problem is it doesn't close the websocket connection, just signals go routines to stop. The connection is left open, but it is going to be closed by the server soon.

@tulir
Copy link
Collaborator

tulir commented Mar 14, 2019

#114 added Disconnect(), so I guess this is fixed now?

@SchulteMK
Copy link
Collaborator

Yes you are right. I must have overlooked this issue when I was closing issues related to that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants