Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BackgroundTaskManager and WaitForBackgroundTasks #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dellis1972
Copy link
Collaborator

Add support classes to allow uses to kick off a background task and then wait for it to complete later in the build process.

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this repo have a test project? We need to add some?

Xamarin.Build.AsyncTask/BackgroundTaskManager.cs Outdated Show resolved Hide resolved
Xamarin.Build.AsyncTask/BackgroundTaskManager.cs Outdated Show resolved Hide resolved
Xamarin.Build.AsyncTask/BackgroundTaskManager.cs Outdated Show resolved Hide resolved
Xamarin.Build.AsyncTask/WaitForBackgroundTasks.cs Outdated Show resolved Hide resolved
Xamarin.Build.AsyncTask/BackgroundTaskManager.cs Outdated Show resolved Hide resolved
Xamarin.Build.AsyncTask/WaitForBackgroundTasks.cs Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Xamarin.Build.AsyncTask/WaitForBackgroundTasks.cs Outdated Show resolved Hide resolved
Xamarin.Build.AsyncTask/WaitForBackgroundTasks.cs Outdated Show resolved Hide resolved
@dellis1972
Copy link
Collaborator Author

So after our chat the other week I am proposing we now do the following.
Expose two properties on the AsyncTask.

public string Category { get; set;} = "default";
public bool BackgroundTask { get; set;} = false;

by default the AsyncTask will work as it does now. However if you set BackgroundTask = true you still need to call base.Exexute but instead of waiting there and then it will register the actual AsyncTask with the background manager.

You can then use the WaitForBackgroundTasks later on in the process as we do now.
I think this makes it less complicated for the end user. They just set a property and call WaitForBackgroundTasks and are done.

@dellis1972
Copy link
Collaborator Author

/azp build

@azure-pipelines
Copy link

Command 'build' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or a specific pipeline for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify a pipeline to run.
    • Example: "run" or "run pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@dellis1972
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 6 in repo xamarin/Xamarin.Build.AsyncTask

@jonathanpeppers
Copy link
Member

Why does it tell you how to run commands then say you aren't allowed???

/azp lol

@dellis1972
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 6 in repo xamarin/Xamarin.Build.AsyncTask

@dellis1972 dellis1972 force-pushed the taskmanager branch 2 times, most recently from 4721d76 to b17e42e Compare November 27, 2019 16:15
public string ErrorCode { get; set; } = "XAT0000";

public override bool Execute ()
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants