#How to create a queue consumption that stays alive "observing" incoming values
27 messages · Page 1 of 1 (latest)
if you are using redis you need pubsub
but really you should just install bull and call it a day
Im aware of bullMQ but Im trying to follow the hardest path as possible lol
pubsub should work as well but maybe something from node? dont know
what?
you need something from redis, not something from node.
hence pubsub.
not exactly!
like I told you my wish would be create something that hears some variable
doing that without library would be the best cenario
but I can only see a recursively function lol
which sounds not great
that's literally what pubsub is
you have a list of items
someone publishes changes to it
someone else subscribes to changes from it
I know pub sub would do the job but the thing Im justing wondering how to make it without
the application Im doing is just to overcomplicate everything and understand better a few things ofc in a real application I wouldnt recreate the wheel
you can't
I mean you can read the whole redis database in a loop and see if there are any changes but that's insane
that means you keep a full copy of the whole database in memory and then you read another full copy every loop and compare
that's absurd
redis has pubsub for a reason
no no Im not saying that I would use redis for that solution
my core need would be how to make "a recursive function/operation to execute something when a variable changes"
when I say variable I can say a simple variable defined on the index of the application like a simple array
that has no need for recursion.