Documentation

Index

Constants

View Source
const DefaultCommandTimeout = 2 * time.Hour

    DefaultCommandTimeout is the total amount of time, including lock acquisition and command runtime, allotted to running a command through mmutex.

    View Source
    const DrainFileName = "mmutex.drain"

      DrainFileName specifies the name of the drain file within $MMUTEX_LOCK_DIR.

      View Source
      const LockFileEnvVariable = "MMUTEX_LOCK_DIR"

        LockFileEnvVariable specifies the directory of the lock file.

        View Source
        const LockFileName = "mmutex.lock"

          LockFileName specifies the name of the lock file within $MMUTEX_LOCK_DIR.

          Variables

          This section is empty.

          Functions

          func RemoveDrainFile

          func RemoveDrainFile(ctx context.Context, drainFilePath string)

          func RunExclusive

          func RunExclusive(ctx context.Context, env subcommands.Env, command func(context.Context) error) error

            RunExclusive runs the command with the specified context and environment while holding an exclusive mmutex lock.

            func RunShared

            func RunShared(ctx context.Context, env subcommands.Env, command func(context.Context) error) error

              RunShared runs the command with the specified context and environment while holding a shared mmutex lock.

              Types

              This section is empty.