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

Graceful shutdown #1

Open
vdakalov opened this issue Mar 9, 2020 · 7 comments
Open

Graceful shutdown #1

vdakalov opened this issue Mar 9, 2020 · 7 comments

Comments

@vdakalov
Copy link

vdakalov commented Mar 9, 2020

Hello. Tell me please, how I can clear this timer?

timer = setInterval(execute,step);

It's need for clear task queue in event loop and graceful shutdown. I studied your code, but I not found public method to make it.

@weswit-team
Copy link

weswit-team commented Mar 9, 2020

Hello,

Executor.js is not a public module and it is not meant to be a general purpose scheduler, so its API only exposes the operations that are strictly needed by the other modules.
On the other hand, if you need to be able to shutdown the executor, it is not difficult to make such an extension.

@weswit-team
Copy link

Hello Viktor,

Maybe I have misunderstood your requirements.
Do you want to destroy the Excutor because (1) you have finished with the LightstreamerClient and you want to release all the resources, or (2) you have found that the Executor survives to the closing of the page and you fear there is some kind of leakage?

@vdakalov
Copy link
Author

vdakalov commented Mar 9, 2020

No, I'm just want to allow nodejs process made graceful shutdown. This is not possible because Executor module has active interval. So, I have to make hard stopping with process.exit(). Otherwise process continue working and this is bad. I'm not work with the library in browser, Node.js only. Also leaks doesn't bother me.

@vdakalov
Copy link
Author

vdakalov commented Mar 9, 2020

This commit solve my problem vdakalov@f8a8e0f

@Lightstreamer Lightstreamer deleted a comment from vdakalov Mar 9, 2020
@weswit-team
Copy link

Hello Viktor,

That makes sense. We will try to add the feature in a next release of the client.

@weswit-team weswit-team reopened this Mar 9, 2020
@vdakalov
Copy link
Author

vdakalov commented Mar 9, 2020

Thank you. I thing it's a single way. Because when I build my own client with other version and build I have error 71 License not valid for this Client type. When I set original LS_CID value, client start works. I understand correctly, any time when you release a new version, it will broken other clients with own LS_CID hash?

@weswit-team
Copy link

Indeed, the rule is that a custom client cannot have a version greater than the last released. Otherwise the server will not accept it. For example, since the last released version is 8.0.2, you cannot use 8.1.0. Our advice is to choose a version having 0 as major number (e.g. 0.X.Y).

We will make the build instructions clearer about this point.

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

No branches or pull requests

2 participants