Commit Graph

5 Commits

Author SHA1 Message Date
Ben Bridle 70a63ae002 Remove multi-threaded code
The server is synchronous and single-threaded for now. The server
uses a RequestProcessor to process requests, which, unlike the
previous `fn(&Request) -> Response` server functions, can hold
state and use that state when processing requests.

In short, the server can now be used for real tasks. Multithreading
will be added back in for a future release, the current single-
-threaded code will not perform well under concurrent loads.
2022-08-25 21:47:16 +12:00
Ben Bridle ab92b5a802 wetstring works right now, uses fn(&Request) -> Response for server function 2022-08-22 16:53:26 +12:00
Ben Bridle 1e83969ebd Give control of the partial request bytes to Request
Before, the partially constructed byte sequence for the request was held outside of the Request object, and each time the program tried to create a Request out of the byte sequence the entire sequence would need to be re-parsed. Now, a Request is constructed up-front, and bytes are periodically pushed to it. This enables the library user to parse more efficiently, by keeping partial parse results inside the Request object and only parsing bytes when they're new to the Request.
2021-08-07 15:05:48 +12:00
Ben Bridle ccd4da433b Make the TcpServer work with bytes instead of strings
This makes it possible to implement byte-based protocols using TcpServer, instead of only being able to implement string-based protocols.
2021-08-07 14:20:59 +12:00
Ben Bridle 3f46685100 Initial commit 2021-08-07 13:59:11 +12:00