2024-08-15 23:29:13 +00:00
|
|
|
module handy_http_transport.interfaces;
|
|
|
|
|
2024-10-22 18:56:28 +00:00
|
|
|
import core.thread.osthread;
|
|
|
|
|
2024-08-15 23:29:13 +00:00
|
|
|
import handy_http_primitives;
|
|
|
|
|
2024-10-22 18:56:28 +00:00
|
|
|
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
|
|
|
}
|