rpc package
Classes
|
Class |
Description |
|---|---|
|
Class ClusteredRedisQueue Implements the possibility to scale queues horizontally between several redis instances. | |
|
Generic cache registry | |
|
Represents a delay expressed as a numeric timer value in a given time unit. Used to defer IMQ request processing. | |
|
Class IMQLock. Implements promise-based locks. | |
|
Arbitrary, JSON-serializable metadata bag carried alongside an IMQ request. Each property value must be a valid JSON value. | |
|
Class RedisCache. Implements a cache engine on top of Redis. | |
|
Class RedisQueue Implements a simple messaging queue over redis. | |
Abstract Classes
|
Abstract Class |
Description |
|---|---|
|
Class IMQClient - base abstract class for service clients. | |
|
Class IMQService Basic abstract service (server-side) implementation |
Enumerations
|
Enumeration |
Description |
|---|---|
Functions
|
Function |
Description |
|---|---|
|
Implements the '@classType' decorator factory. Applied to a complex-type class, it registers the class's '@property' field definitions into the RPC type description so the type can be exposed to service clients. It is required on any class that uses '@property': standard (TC39) field decorators cannot see the class they belong to, so a class-level decorator is needed to flush the collected properties under the class name. | |
|
Returns the metadata of the in-flight IMQ request for the current async execution, if any. Returns {IMQMetadata | undefined} | |
|
Expose decorator factory. Applied to a service method, it registers that method in the RPC service description. (Complex argument/return types are registered separately via the '@classType' decorator on those classes.) {(value: any, context: ClassMethodDecoratorContext) => void} | |
|
Builds a call rejector that rejects the pending promise and then runs the optional after-call hook. | |
|
Builds a call resolver that resolves the pending promise and then runs the optional after-call hook. | |
|
Builds a JSON representation of an IMQ error. | |
|
Implements '@indexed' decorator factory This is used to specify complex service types which are need to expose types containing indexed definition, for example: | |
|
Creates a | |
|
logDebugInfo({ debugTime, debugArgs, className, args, methodName, start, logger, logLevel, }, input) |
Logs debug information about a function call |
|
Creates a | |
|
Implements '@profile' decorator. | |
|
Flushes definitions collected on a class into the RPC type description. Invoked by class-level decorators once the class (and hence its name) is available. | |
|
Creates a {Function} - a dual-mode method decorator | |
|
Runs the given function with The binding is scoped to the function: it is established for the duration of the call and automatically removed afterwards, which keeps concurrent requests isolated from one another. | |
|
Sends IMQ response with support of after call optional hook | |
|
Validates a log level value or returns the default |
Interfaces
|
Interface |
Description |
|---|---|
|
Method argument description | |
|
Generic cache adapter interface. Any cache engine implementation must conform to this contract to be usable within IMQ. | |
|
Constructor signature for cache adapter implementations. | |
|
Logger interface | |
|
Defines a message format. {IMessage} | |
|
Generic messaging queue implementation interface | |
|
Hook invoked after a service method call has been handled. | |
|
Hook invoked before a service method call is dispatched. | |
|
Options accepted by a generated IMQ client. | |
|
Options for the built-in metrics server. | |
|
Message queue options | |
|
Response error data structure, which service returns if error occurred during service method execution. | |
|
Request message data structure to be handled by a service. | |
|
Response message data structure that a service replies with to handled requests. | |
|
Options accepted by an IMQ service. | |
|
Extends the default Redis type to allow dynamic properties access on it {IRedisClient} | |
|
Represents JSON-serializable array | |
|
Represents JSON serializable object | |
|
Method description | |
|
Methods collection description | |
|
Type property description | |
|
Return value description | |
|
Service class description | |
|
Service description | |
|
Type properties collection description | |
|
Entire service types metadata structure | |
Variables
|
Variable |
Description |
|---|---|
|
Creates a | |
|
Default client options {IMQClientOptions} | |
|
Default metrics server options {NonNullable | |
|
Default service options {IMQServiceOptions} | |
|
Grace period (ms) for a graceful QUIT to complete before a channel is forcibly disconnected. A reader blocked on an infinite BRPOP/BLMOVE can never let QUIT through, so without this the socket would leak and keep the process alive. | |
|
Environment variable IMQ_LOG_ARGS=[1, 0]. Enable or disable logging of profiled call arguments. {boolean} | |
|
Environment variable IMQ_LOG_TIME_FORMAT. Specifies the format for profiled time logging. Values: 'microseconds', 'milliseconds', 'seconds'. Default: 'microseconds' {AllowedTimeFormat | string} | |
|
Environment variable IMQ_LOG_TIME=[1, 0]. Enable or disable profiled timing logging. {boolean} | |
Type Aliases
|
Type Alias |
Description |
|---|---|
|
Represents any JSON-serializable value | |
|
Accepted cache adapter references: a constructor, an instance, or an adapter name. | |
|
Subset of the manager options handed over to the UDP worker thread. Only structured-cloneable values may appear here (no logger). |