Closed gegles closed 1 year ago
Hi!
I think you've already found the best way to solve your case.
I don't think we'll introduce some kind of base class with pure virtual method(s) in RESTinio for representing an abstract http server. It's because this will recure a (probably seriour) redisign of a part of the library. But the case like your encounters not to often and can easily solved by a solution like your.
Ok, thanks!
I still think everybody could benefit from that base class, but we can live without it for now.
Hello,
I've got a high-level class (
RestAPI
) that needs hold on to arunning_server_handle_t
obtained from a call torestinio::run_async
and so as to be able to callstop()
on it at some point later.Depending on some config file, the restinio server can be of two distinct traits (either regular or tls).
It would be really nice if
running_server_handle_t
/running_server_instance_t
could inherit from a non-templated base class so that a more generic handle could be used regardless of the traits if only to access methods likestop()
.Currently what I've done is:
In my header:
In the private impl:
But if the restinio classes had some shared base class, I wouldn't need this cruft...
Let me know if maybe I am missing a better way or if this base class could be implement in restinio.
Thanks!