mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
27 lines
441 B
TypeScript
27 lines
441 B
TypeScript
import { BaseRpcContext } from './base-rpc.context';
|
|
|
|
type NatsContextArgs = [string, any];
|
|
|
|
/**
|
|
* @publicApi
|
|
*/
|
|
export class NatsContext extends BaseRpcContext<NatsContextArgs> {
|
|
constructor(args: NatsContextArgs) {
|
|
super(args);
|
|
}
|
|
|
|
/**
|
|
* Returns the name of the subject.
|
|
*/
|
|
getSubject() {
|
|
return this.args[0];
|
|
}
|
|
|
|
/**
|
|
* Returns message headers (if exist).
|
|
*/
|
|
getHeaders() {
|
|
return this.args[1];
|
|
}
|
|
}
|