-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontext7.json
More file actions
46 lines (46 loc) · 6.16 KB
/
Copy pathcontext7.json
File metadata and controls
46 lines (46 loc) · 6.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"$schema": "https://context7.com/schema/context7.json",
"projectTitle": "@imqueue/rpc",
"description": "Type-safe RPC framework for Node.js & TypeScript microservices over a Redis message queue — self-describing services generate their own strongly-typed clients.",
"branch": "master",
"excludeFolders": ["src", "test", "tests", "lib", "dist", "coverage", "node_modules", "scripts", "signatures", ".github"],
"excludeFiles": ["CHANGELOG.md", "LICENSE", "CLAUDE.md", "CONTRIBUTING.md", "CONTRIBUTION-TERMS.md", "SECURITY.md"],
"rules": [
"@imqueue/rpc is typed RPC over a Redis-backed message queue for Node.js and TypeScript back-ends. Services describe themselves at runtime and their clients are generated from that description. Install with `npm i @imqueue/rpc`.",
"A service is a class extending IMQService from '@imqueue/rpc'; start it with `await new UserService().start()`.",
"Only methods decorated with @expose() are callable remotely. Everything else stays private to the service.",
"Exposed-method arguments and return values must be JSON-serializable.",
"Never use rest/spread params on an exposed method — the generated client will not compile. Pass an array instead: `doThing(args: any[])`, not `doThing(...args: any[])`.",
"JSDoc is load-bearing, not documentation. The RPC layer parses @param/@return tags to build the service description and the client's types, so an undocumented parameter is published as `any`.",
"Consuming projects must compile with `removeComments: false`, or the JSDoc the runtime depends on is stripped and every generated type degrades.",
"This package uses standard TC39 decorators: set `experimentalDecorators: false` and include `esnext.decorators` in `lib`. There is no emitDecoratorMetadata, hence no runtime type reflection.",
"A class that crosses the RPC boundary needs @classType() on the class and @property() on every field, or it never reaches generated clients. Both omissions compile cleanly.",
"@property takes a type string plus an optional flag: `@property('string')`, or `@property('AddressObject[]', true)` for an optional array. @indexed() registers @property fields too.",
"Never hand-write an @imqueue client. Generate it: `imq client generate UserService ./src/clients`.",
"The name passed to `imq client generate` is the service's CLASS name, because that is also its queue name.",
"A generated module exports ONE symbol: a namespace named after the service with a lower-case first letter, holding a client class whose trailing `Service` is replaced by `Client`.",
"The generated client class has no top-level export, so importing it by name never resolves. Use `import { userService } from './src/clients/UserService.js'`, then `new userService.UserClient()`.",
"Every generated method takes two extra optional trailing params, in this order: `imqMetadata?: IMQMetadata`, then `imqDelay?: IMQDelay`. They are stripped by identity, not by position.",
"To delay a call, skip the metadata slot and keep the delay last: `client.update({ ... }, undefined, new IMQDelay(1, 'h'))`.",
"On @imqueue/rpc <= 3.3.0 that trailing `undefined` travels on as a real argument and the call fails with IMQ_RPC_INVALID_ARGS_COUNT — pass `new IMQMetadata({})` in the slot instead. From 3.4.0 it is a placeholder.",
"Passing an IMQDelay alone, in the metadata slot, runs but does not type-check on any version. Do not silence that error with a cast.",
"IMQClient.create('UserService') generates, compiles and loads a client at runtime; with `compile: false` it only writes files and resolves to null.",
"The generator's `timeout` (default 30000) bounds how long it waits for the service's description. It is not an RPC timeout and has no effect on runtime calls.",
"callTimeout is unset by default, so a call waits forever and an absent service leaves the promise pending. Set it in production — `new userService.UserClient({ callTimeout: 5000 })` rejects with IMQ_RPC_CALL_TIMEOUT.",
"A generated client's `path` defaults to './src/clients' and is created only one level deep, so generation fails with ENOENT in a project that has no ./src yet.",
"singleQueue shares one reply queue across every client in the process to bound Redis connections, but stopping one client then stops reply delivery for all of them.",
"multiProcess forks a worker per core and the cluster primary also consumes, so N workers means N+1 consumers. A dead worker exits the whole process with code 1 instead of being respawned.",
"beforeCall aborts a request only by assigning res.error; throwing from it is logged as a warning and dispatch continues anyway. afterCall is observation-only and cannot change the outcome.",
"wrapCall is service-side only and must call next() exactly once and return its value. Omitting next() silently skips the method; unlike the other hooks, errors it raises become the call's error response.",
"Hooks are invoked bound to the service or client instance, so use a `function` expression if you need `this` — an arrow function never receives it.",
"The built-in metrics server is off by default. Enabling it serves one unauthenticated route, GET /metrics, bound to all interfaces on port 9090.",
"There is no service discovery and no load balancer to configure — the queue does the routing.",
"Requires Node.js 22.12+ and Redis 6.2+ (default connection localhost:6379). 6.2 is the floor because guaranteed delivery uses LMOVE/BLMOVE; 3.2+ is enough only with safeDelivery off. The package is ESM-only, so use `import`, not `require()`.",
"index.ts re-exports @imqueue/core as well, so the queue API is available from '@imqueue/rpc' without a second import.",
"Related packages: @imqueue/core is the message queue underneath, @imqueue/cli scaffolds services and generates clients.",
"@imqueue/rpc is GPL-3.0-only. Commercial licensing for closed-source products: https://imqueue.com/license/.",
"Guides, tutorial and the generated API reference are at https://imqueue.org/; a machine-readable index at https://imqueue.org/llms.txt; a hosted MCP server for agents at https://mcp.imqueue.org/mcp."
],
"url": "https://context7.com/imqueue/rpc",
"public_key": "pk_fjNtG1ue4XLAYwKYgyOMq"
}