aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IScheduler.cs
blob: f850a94add22e8794a115f01deecdccc3b001883 (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
using System;

namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
    interface IScheduler
    {
        /// <summary>
        /// Schedule an event callback to occur
        /// when 'time' is elapsed.
        /// </summary>
        /// <param name="time">The period to wait before executing</param>
        void RunIn(TimeSpan time);

        /// <summary>
        /// Schedule an event callback to fire
        /// every "time". Equivilent to a repeating
        /// timer.
        /// </summary>
        /// <param name="time">The period to wait between executions</param>
        void RunAndRepeat(TimeSpan time);

        /// <summary>
        /// Fire this scheduler only when the region has
        /// a user in it.
        /// </summary>
        bool IfOccupied { get; set; }

        /// <summary>
        /// Fire this only when simulator performance
        /// is reasonable. (eg sysload <= 1.0)
        /// </summary>
        bool IfHealthy { get; set; }

        /// <summary>
        /// Fire this event only when the region is visible
        /// to a child agent, or there is a full agent
        /// in this region.
        /// </summary>
        bool IfVisible { get; set; }

        /// <summary>
        /// Determines whether this runs in the master scheduler thread, or a new thread
        /// is spawned to handle your request. Running in scheduler may mean that your
        /// code does not execute perfectly on time, however will result in better
        /// region performance.
        /// </summary>
        /// <remarks>
        /// Default: true
        /// </remarks>
        bool Schedule { get; set; }
    }
}