transport/source/handy_http_transport/interfaces.d

25 lines
529 B
D
Raw Normal View History

2024-08-15 23:29:13 +00:00
module handy_http_transport.interfaces;
import core.thread.osthread;
2024-08-15 23:29:13 +00:00
import handy_http_primitives;
abstract class HttpTransport {
protected HttpRequestAcceptor requestAcceptor;
this(HttpRequestAcceptor requestAcceptor) {
this.requestAcceptor = requestAcceptor;
}
abstract void start();
Thread startInThread() {
Thread t = new Thread(&this.start);
t.start();
return t;
}
}
interface HttpRequestAcceptor {
void accept(HttpRequest request, HttpResponse response);
2024-08-15 23:29:13 +00:00
}