summaryrefslogtreecommitdiff
path: root/src/lib/ecore/efl_task.eo
blob: 9fe006a34c713a88efa9df802f004574a2ea43ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
enum Efl.Task_Priority {
   [[How much processor time will this task get compared to other tasks running on
     the same processor.
     @since 1.22
   ]]
   normal,     [[Neither above nor below average priority. This is the default.]]
   background, [[Far below average priority.]]
   low,        [[Below average priority.]]
   high,       [[Above average priority.]]
   ultra       [[Far above average priority.]]
}

enum Efl.Task_Flags {
   [[Flags to further customize task's behavior.
     @since 1.22
   ]]
   none               = 0, [[No special flags.]]
   use_stdin          = 1, [[Task will require console input.]]
   use_stdout         = 2, [[Task will require console output.]]
   no_exit_code_error = 4, [[Task will not produce an exit code upon termination.]]
   exit_with_parent   = 8, [[Exit when parent exits.]]
}

abstract Efl.Task extends Efl.Loop_Consumer
{
   [[EFL's abstraction for a task (process).
     @since 1.22
   ]] // TODO: This needs more detail.
   methods {
      @property priority {
         [[The priority of this task.]]
         get { }
         set { }
         values {
            priority: Efl.Task_Priority; [[Desired priority.]]
         }
      }
      @property exit_code {
         [[The final exit code of this task. This is the code that will be produced upon task completion.]]
         get { }
         values {
            code: int; [[The exit code.]]
         }
      }
      @property flags {
         [[Flags to further customize task's behavior. The default value:
             exit_with_parent
         ]]
         set { }
         get { }
         values {
            flags: Efl.Task_Flags; [[Desired task flags.]]
         }
      }
      run @pure_virtual {
         [[Actually run the task.]]
         return: future<void> @owned; [[A future triggered when task exits and is passed int exit code.]]
      }
      end @pure_virtual {
         [[Request the task end (may send a signal or interrupt
           signal resulting in a terminate event being tiggered in the
           target task loop).]]
      }
   }
   events {
   }
   implements {
      Efl.Object.constructor;
      Efl.Object.destructor;
      Efl.Object.parent { set; }
   }
}