@Override
    public void run() {
      switch (workType) {
        case CALL_ON_START_JOB: // called on main thread
          jobService.callOnStartJobImpl(jobParameters);
          return;

        case CALL_ON_STOP_JOB: // called on main thread
          jobService.callOnStopJobImpl(
              jobCallback, /* needToSendResult= */ boolValue, terminatingResult);
          return;

        case HANDLE_ON_UNBIND_EVENT:
          jobService.handleOnUnbindEventImpl(unbindIntent);
          return;

        case HANDLE_START_JOB_REQUEST:
          jobService.handleStartJobRequestImpl(jobParameters, remoteJobCallback);
          return;

        case HANDLE_STOP_JOB_REQUEST:
          jobService.handleStopJobRequestImpl(jobParameters, /* needToSendResult= */ boolValue);
          return;

        case FINISH_JOB_WITH_RESULT:
          jobCallback.sendResult(terminatingResult);
          return;

        case REMOVE_AND_FINISH_JOB_WITH_RESULT:
          jobService.removeAndFinishJobWithResultImpl(
              jobParameters, /* result= */ terminatingResult);
          return;

        default:
          throw new AssertionError("unreachable");
      }
    }
Creats a Runnable that calls {@link
JobService#removeAndFinishJobWithResultImpl(JobParameters, int)}.
jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobService.java