/*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
\defgroup AsyncJobs Asynchronous Jobs
\ingroup Components
-\section Terminology Terminology
+\section AsyncJobsTerminology Terminology
- \b Job: an AsyncJob object.
- \b Creator: the code creating the job. Usually the Initiator.
- \b Start: the act of calling AsyncJob::Start with a job pointer.
- \b Initiator: the code starting the job. Usually the Creator.
-\section Life Typical life cycle
+\section AsyncJobsLifecycle Typical life cycle
-# Creator creates and initializes a job.
-# If Initiator expects to communicate with the job after start,
or some custom method that the job creator will call _before_ calling
AsyncJob::Start():
- std::auto_ptr<MyJob> job(new MyJob(...)); // sync/blocking
+ std::unique_ptr<MyJob> job(new MyJob(...)); // sync/blocking
job->prepare(...); // sync/blocking
job->prepareSomethingElse(...); // sync/blocking
AsyncStart(job.release()); // non-blocking
you call AsyncJob::Start with a job pointer.
-\section Rules Basic rules
+\section AsyncJobsBasicRules Basic rules
- To start a job, use AsyncJob::Start.
Do not start the same job more than once.