Pass options alongside the message/event (client proxy)
See original GitHub issueFeature Request
Is your feature request related to a problem? Please describe.
I want to set expiration in options, but it’s not supported right now.
Describe the solution you’d like
export interface ReadPacket<T = any> {
pattern: any;
data: T;
options:any
}
protected dispatchEvent(packet: ReadPacket): Promise<any> {
return new Promise((resolve, reject) =>
this.channel.sendToQueue(
this.queue,
Buffer.from(JSON.stringify(packet)),
packet.options,
err => (err ? reject(err) : resolve()),
),
);
}
public emit<TResult = any, TInput = any>(
pattern: any,
data: TInput,
options:any
): Observable<TResult> {
if (isNil(pattern) || isNil(data)) {
return _throw(new InvalidMessageException());
}
return defer(async () => this.connect()).pipe(
mergeMap(() => this.dispatchEvent({ pattern, data, options })),
);
}
Teachability, Documentation, Adoption, Migration Strategy
What is the motivation / use case for changing the behavior?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Server Sent Events - The Modern JavaScript Tutorial
To pass credentials, we should set the additional option withCredentials , like this: let source = new EventSource( ...
Read more >Microservices | NestJS - A progressive Node.js framework
Hint The ClientProxyFactory is imported from the @nestjs/microservices package. Another option is to use the @Client() property decorator. @Client( ...
Read more >EventSource.Builder (okhttp-eventsource 2.7.0 API) - javadoc.io
Set the HTTP proxy address to be used to make the EventSource connection ... Specifies whether EventSource should send a MessageEvent to the...
Read more >slack_bolt API documentation - Slack Platform Developer Tools
The bot/user access token required only for single-workspace app. token_verification_enabled: Verifies the validity of the given token if True. client: The ...
Read more >API Reference - discord.py
A number of options can be passed to the Client . Parameters ... BasicAuth ]) – An object that represents proxy HTTP Basic...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We should probably provide a way to somehow pass down the options through the
ClientProxy
. I’ll check what we can do here.any news on this? I’d like to pass on header options (ClientProxy.send())