Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use golang-queue to run async actions #519

Closed
wants to merge 1 commit into from

Conversation

Hamsajj
Copy link
Contributor

@Hamsajj Hamsajj commented Apr 28, 2024

Ticket(s)

#464

Description

This PR aims to add queue for async action using golang-queue project.

This is in draft mode right now as it is not finished. I plan to do the following steps to call it done.

  • use an internal golang-queue to queue and run async actions (already done)
  • make an act.Queue module as a wrapper around golang-queue which is configurable to either use internal or external (redis?) queue.
  • create a new command that can be configured to listen to a external queue to run async actions (maybe part of Add distributed runner for running actions #472 and not this one?)

@Hamsajj
Copy link
Contributor Author

Hamsajj commented May 12, 2024

@mostafa to give an update, I'm working on this PR, but I have faced a problem with golang-queue project when using a redis. I think it is a bug on their but I'm not yet 100% sure.
Trying to figure out better and see if I can fix it.
Just wanted to give an update on why it's taking longer than I anticipated

@mostafa
Copy link
Member

mostafa commented May 12, 2024

What exactly is the problem? I know a thing or two about Redis.

@Hamsajj
Copy link
Contributor Author

Hamsajj commented May 13, 2024

If you try the example code in golang-queue project for redis pub/sub (here), it does not work either.

The problem is in this line of that project
https://github.com/golang-queue/redisdb/blob/9c16bbdd242b9461b5b730201af064cd21a27f7f/redis.go#L155

A decoding error happens when reading data back from redis, but it is ignored. Later on the code encounters an index out of range error because of it.
I don't think the problem is about redis (or maybe it is, if pub/sub adds some metadata or overhead to the message which should be expected or skipped while decoding?)

I guess I'll create an issue on their repo while also looking more into it to see if I can find out why that happens.

@mostafa
Copy link
Member

mostafa commented May 13, 2024

@Hamsajj Definitely a serialization issue. I can (also) look into the library in the afternoon if you want.

@Hamsajj
Copy link
Contributor Author

Hamsajj commented May 27, 2024

Based on our discussion, we decided to abandon using golang-queue for now and implement a lightweight and simple support for using Redis pub/sub as a queue for async actions

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.

None yet

2 participants