package com.atlassian.bitbucket.mesh.execution;

import javax.annotation.Nonnull;

/**
 * Callback provided to callers of {@link ExecutionManager#withContext(ExecutionCallback)}.
 */
@FunctionalInterface
public interface ExecutionCallback<T> {
    
    /**
     * Callback method that is called by {@link ExecutionManager#withContext(ExecutionCallback)}
     * 
     * @param context the current execution context
     * @return the value that should be returned by {@link ExecutionManager#withContext(ExecutionCallback)}
     */
    T callWithContext(@Nonnull ExecutionContext context);
}
