Updated a match expression to use an enum instead of dispatching on an integer

In the resume_task_from_queue function a two-phase match expression is present, and I converted it from integer dispatch to using an enum as per the comment on the last pull request.