Skip to content

Handle send message event in a local setup (dev. localhost)#131

Merged
AchoArnold merged 3 commits intoNdoleStudio:mainfrom
eriksson:handle_local_event_queue
Mar 20, 2023
Merged

Handle send message event in a local setup (dev. localhost)#131
AchoArnold merged 3 commits intoNdoleStudio:mainfrom
eriksson:handle_local_event_queue

Conversation

@eriksson
Copy link
Copy Markdown
Contributor

When running in development environment, usually bound to the localhost, there is no way to use Cloud Task to trigger the internal api /events.
We can rely on an internal timeout to simulate the a task processing queue.

@what-the-diff
Copy link
Copy Markdown

what-the-diff Bot commented Mar 16, 2023

  • Added a check to see if the queue is nil.
  • If it's not, then we create and enqueue a task as usual.
  • Else, we just add an item to the queue with no timeout (i think).

@AchoArnold AchoArnold closed this Mar 16, 2023
@AchoArnold AchoArnold reopened this Mar 16, 2023
Comment thread api/pkg/services/event_dispatcher_service.go Outdated
@AchoArnold AchoArnold merged commit 6028167 into NdoleStudio:main Mar 20, 2023
@AchoArnold
Copy link
Copy Markdown
Member

Hello @eriksson

Thanks for the PR. I merged it and I did a bit of refactoring, perhaps you can take it into account in the other PR. see this commit 5cf3cc5

@eriksson eriksson deleted the handle_local_event_queue branch March 20, 2023 21:32
@eriksson
Copy link
Copy Markdown
Contributor Author

Hello @eriksson

Thanks for the PR. I merged it and I did a bit of refactoring, perhaps you can take it into account in the other PR. see this commit 5cf3cc5

Great. I analysed the refactor in 5cf3cc5 and it makes a lot of sense as it completely emulates the cloud queue by following the same path. I tried to avoid calling the api and use the internal event dispatcher but maybe that is not the best solution here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants