question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass options alongside the message/event (client proxy)

See original GitHub issue

Feature 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:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
kamilmysliwieccommented, Oct 3, 2019

We should probably provide a way to somehow pass down the options through the ClientProxy. I’ll check what we can do here.

1reaction
MatthiasBrandtcommented, Aug 12, 2020

any news on this? I’d like to pass on header options (ClientProxy.send())

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found