Skip to content

Perform Actions need to be a queue and thread-safe. #1

Description

@dravenk

In the base release, of course, I marked unsafe handling for Perform actions.

// Perform an Action in a goroutine.
go action.Start()

Goroutine is not a queue. Not ensuring that actions are executed in order is the wrong way to handle multiple concurrent action requests. Channels are often used in Golang to handle communication or to implement a task queue. I plan is to create a runner similar to the Java version to execute actions.

    /**
     * Thread to perform an action.
     */
    private static class ActionRunner extends Thread {
        private Action action;

        /**
         * Initialize the object.
         *
         * @param action The action to perform
         */
        public ActionRunner(Action action) {
            this.action = action;
        }

        /**
         * Perform the action.
         */
        public void run() {
            this.action.start();
        }
    }

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions