title: Get return status from Background Tasks in FastAPI
body: <p>I have an API which posts jobs upon which background jobs are created and I want to send status of job on another GET api. How to achieve this? In <code>background_work()</code> function I am going with multiprocessing as call internally targets <code>subprocess.call()</code> calls.</p>
  
  <pre><code>from fastapi import BackgroundTasks, FastAPI
  
  app = FastAPI()
  
  def background_work(data: str):
      # some computation on data and return it
      return status
  
  @app.post("/post_job", status_code=HTTP_201_CREATED)
  async def send_notification(data: str, background_tasks: BackgroundTasks):
      background_tasks.add_task(background_work, data)
      return {"message": "Job Created, check status after some time!"}
  
  @app.get("/get_status")
  def status():
      #how to return status of job submitted to background task
  
  </code></pre>