-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move more specific functions to the only files they're used. * Move the `serve*` functions outside of `Context`, making them free functions which just accept the context and work pool. * Remove `acceptAndServeConnection`; originally this was required to be able to nicely structure the unit test, and used to be more integrated, however it no longer makes sense as a concept. * Inline `handleRequest` into the basic backend. * Make the `acceptHandled` function, moved into the basic backend, guarantee the specified `sync` behavior, and inline `have_accept4`. * Appropriately re-export the relevant parts of the server API. * Added top level doc comments.
- Loading branch information
1 parent
7629280
commit 3e6c4fb
Showing
6 changed files
with
244 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
//! RPC Server API. | ||
//! | ||
//! The server can be run by calling `serveSpawn`, or `serve`; in | ||
//! order to do this, the caller must first initialize a `Context` | ||
//! to provide the basic state and dependencies required to operate | ||
//! the server, and must also provide a `WorkPool`, initialized to | ||
//! a given backend. | ||
|
||
const server = @import("server.zig"); | ||
|
||
comptime { | ||
_ = server; | ||
} | ||
|
||
pub const MIN_READ_BUFFER_SIZE = server.MIN_READ_BUFFER_SIZE; | ||
|
||
pub const serveSpawn = server.serveSpawn; | ||
pub const serve = server.serve; | ||
|
||
pub const Context = server.Context; | ||
pub const WorkPool = server.WorkPool; | ||
|
||
// backends | ||
pub const basic = server.basic; | ||
pub const LinuxIoUring = server.LinuxIoUring; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.