bolcom / libunftp

Extensible, async, cloud orientated FTP(S) server library and the core of unFTP: https://github.com/bolcom/unFTP. Follow up and talk to us on https://t.me/unftp
Apache License 2.0
188 stars 35 forks source link

start and stop by different methods #472

Closed leo-je closed 3 months ago

leo-je commented 1 year ago

I want to encapsulate two methods, start() and stop(), to control the startup and shutdown of the FTP service, but it seems that I can only start it. How can I implement stop()?

hannesdejager commented 1 year ago

Hi @leo-je , to strop you can provide a Future to the shutdown_indicator method on Server. You future should then resolve when your stop method is called.

Here is an example in unFTP where we resolve this future when a message is received on a channel.

hannesdejager commented 3 months ago

@leo-je , hopefully you resolved it by now. I'm closing this.