firepear / petrel

It's like SQLite, but for networking
MIT License
20 stars 1 forks source link

Adding Req and Resp to petrel.Conn #74

Open firepear opened 2 hours ago

firepear commented 2 hours ago

Creating structs for a request object and a response object means that data can live within the Conn.

This should allow the removal of all transient data from the network read/write functions, making everything cleaner.

It also means that ConnRead no longer has to return a mystifying collection of things; it will simply update the Conn's Resp and return nothing but an err. And that err won't be overloaded with app-level information on the status of the request; it will only indicate whether there was an error with the read or not. Request status will be in the request struct.

firepear commented 2 hours ago

A consequence of this is going to be that basically all tests are going to become worthless. Should add an issue for that.