Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,32 @@ go get github.com/mcriley821/jsonrpc2
| `Handler` | Processes incoming requests. Use `Mux` + `Handle`/`HandleNotification` for typed, per-method dispatch. |
| `Error` | A JSON-RPC error object. `NewError` creates one; return it from a handler to send an error response. |

## Comparison

| Feature | This | [x/exp][xexp] | [jrpc2][jrpc2] | [sourcegraph][sg] | [AdamSLevy][al] | [bubunyo][bu] |
|---------|:----:|:-------------:|:--------------:|:-----------------:|:---------------:|:-------------:|
| Transport agnostic | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Bidirectional async | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Batch requests | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
| `Conn` passed to handler | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
| Typed handlers (Go generics) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Mux / per-method routing | ✅ | ❌ | ✅ | ❌ | ✅ | ✅ |
| Replier callback | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Fallback handler | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| `slog`-compatible logger | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Nullable params | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Notification-only handlers | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Concurrency control | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |

> This table is a best-effort snapshot and may contain errors or omissions. Library features change over time — consult each project's documentation for the authoritative API.
> Contributions are welcome — open an issue to add a library or correct an entry.

[xexp]: https://pkg.go.dev/golang.org/x/exp/jsonrpc2
[jrpc2]: https://github.com/creachadair/jrpc2
[sg]: https://github.com/sourcegraph/jsonrpc2
[al]: https://github.com/AdamSLevy/jsonrpc2
[bu]: https://github.com/bubunyo/go-rpc

## Examples

See [`example_test.go`](./example_test.go) for runnable examples covering the full server-client flow, typed handlers, nullable params, error responses, raw handler registration, and connection lifecycle.
Expand Down
Loading