I have a queue of actions shared between clients, capturing user activity and being performed by a robot on another site. An example of an activity might look like this:
CREATE FOLDER /docs
CREATE FILE /docs/journal.txt
DELETE FILE /docs/blog.txt
MOVE FOLDER /docs/images /docs/photos
...
Often there are actions that can be reduced to one or not. For instance:
CREATE FOLDER /docs
RENAME FOLDER /docs /documents
You can simply change to:
CREATE FOLDER /documents
And something like:
CREATE FOLDER /docs
RENAME FOLDER /documents
DELETE FOLDER /documents
Can be completely removed from the queue.
This kind of reduction / optimization seems to be a very common problem, and before the attack I would like to try some general solution. This is similar to a path search optimization problem.
Any ideas?
source
share