anchor.diff:  -spec is_job_cancelled(id()) -> boolean().
   is_job_cancelled(TaskId) ->
       receive
  -        {'$gen_cast',{cast,{?MODULE, ?FUNCTION_NAME, [TaskId]}}} = Msg -> 
  -            self() ! Msg, % resend message so next calls to this function return correct result
  +        ?CANCELLATION_MESSAGE_MATCHER(TaskId) = Msg -> 
  +            % Resend message so next calls to this function from the same job return correct result. 
  +            % After job execution finishes this message will be handled by worker_pool resulting in 
  +            % its removal from message queue. It is enough as following jobs queued on worker pool 
  +            % check whether task is cancelled before execution.
  +            self() ! Msg, 
               true
       after 
           0 -> false
  
positive.code: execute_slave_job(PoolName, CallbackModule, ExtendedCtx, TaskId, Job) ->
      try
          case traverse_task:is_cancelled(PoolName, TaskId) of
              true -> 
                  ok;
              false ->
                  case CallbackModule:do_slave_job(Job, TaskId) of
                      ok ->
                          ok;
  
negative.code:     log_error_with_stacktrace(Stacktrace, Format, Args)
  ).
  
  
  %% Message broadcasted to all workers on pool (see broadcast_job_cancellation/2). 
  %% Its existence in message queue determines whether given task was cancelled.
  %% As this message is a worker_pool cast message `is_job_cancelled` function will be executed 
  %% after job execution is finished, which will result in removal of this message from process message queue.
  -define(CANCELLATION_MESSAGE(TaskId), {?MODULE, is_job_cancelled, [TaskId]}).
  -define(CANCELLATION_MESSAGE_MATCHER(TaskId), {'$gen_cast', {cast, ?CANCELLATION_MESSAGE(TaskId)}}).
  
  %%%===================================================================
  %%% API
  %%%===================================================================
  