Fortran · 647 bytes Raw Blame History
1 program job_lifecycle_demo
2 use fgof_jobs, only : &
3 attach_job, &
4 complete_job, &
5 configure_job, &
6 job_exit_result, &
7 job_is_finished, &
8 job_needs_cleanup, &
9 make_job_spec
10 use fgof_jobs_types, only : job_handle, job_spec
11 implicit none
12
13 type(job_spec) :: spec
14 type(job_handle) :: handle
15
16 spec = make_job_spec("worker")
17 call configure_job(handle, spec)
18 call attach_job(handle, 41)
19 call complete_job(handle, job_exit_result(0, pid=41, process_group=41))
20
21 write (*, '(a,l1)') "finished=", job_is_finished(handle)
22 write (*, '(a,l1)') "cleanup=", job_needs_cleanup(handle)
23 end program job_lifecycle_demo
24