Add docs for new stuff

This commit is contained in:
Jon Staab
2025-08-01 14:32:57 -07:00
parent 1f5f869f7c
commit c6434028a6
5 changed files with 200 additions and 0 deletions
+9
View File
@@ -2,6 +2,15 @@
Socket policies provide automated behavior for socket connections. They are intended to be applied on socket creation via `makeSocket` or `PoolOptions.makeSocket`.
## Types
### SocketPolicy
```typescript
type SocketPolicy = (socket: Socket) => Unsubscriber
```
The contract for socket policies. Takes a Socket object and returns a cleanup function that should be called when the policy is no longer needed.
## Built-in Policies
### `socketPolicyAuthBuffer`