This is a placeholder. I need to write an async tasker. c0redP (Core-P aka Personality Core)
-
c0re(
success_callback (function), failed_callback (function), options (object))
: returnsc0re instance
Constructor Function
success_callback
The callback to be executed when the queue is considered to be completed successfully. This is affected byoptions.determinative
failed_callback
The callback to be executed when the queue is considered to be completed unsuccessfully. This is affected byoptions.determinative
options
contains settings. Refer to 'Properties' below.Example:
myc0re = new c0re(function(argIn){}, function(argIn){}, {'cycle_type':'pool', 'tasker_type': 'iterator','pool_size': 20});
-
c0re.has(
key (string))
: returnsboolean [true|false]
-
determinative
: readonlystring ['all'|'~all'|'pos']
defaultall
Completion Determinative
determinative
helps determine what threshold of successful calls to execute thesuccess_callback
orfailed_callback
-
all
when success rate is 100% -
~all
when success rate is not 0% -
pos
when success rate is greater than failure rate
-
-
queue
: readonlyarray [
c0reModel]
Callback Queue
queue
contains a list of modelsc0reModel
. -
temp_queue
: readonlyarray [
c0reModel]
Temporary Queue
temp_queue
contains a list of modelsc0reModel
. This jumps to the head of thequeue
and can only be accessed internally withenqueue_once()
-
silent
: readonlyboolean [true|false]
defaultfalse
Silent Mode
silent
if true enable extra warnings & debugging -
pool_size
: special-readonlynumber [>1]
default1
Pool Size
pool_size
variable is readonly but can be changed withset_pool()
. It changes async (in its own task queue). Ifcycle_type
is 'queue' then it cannot be changed. Number must be greater than 1. -
fixed_fps
: readonlyboolean [true|false]
defaulttrue
FPS Setting is Readonly
fixed_fps
determines if thec0redP.fps
can be changed (below). -
fps
: special-readonlynumber [>1]
default15
Frames Per Second
fps
determines the frames per second target. -
cycle_type
: readonlystring ['iterator'|'generator']
defaultiterator
Cycle Type
cycle_type
determines the frames per second target.-
iterator
Once completed it will stop -
generator
Once completed it will reset and run again
-
-
tasker_type
: readonlystring ['queue'|'pool'|'fuzzy']
defaultqueue
Tasker Type
tasker_type
determines how the tasks are ran.-
queue
forces theoptions.pool_size
to always be one forcing tasks to be completed in sequence (WIP - Shouldn't have to use pool of 1 but rather call the completed in order) -
pool
allows for a number to tasks to be active based on theoptions.pool_size
variable -
fuzzy
(WIP) not currently supported. Allows for idle task management
-
-
large_cycle
: readonlyobject
Large Cycle
large_cycle
is similar tosmall_cycle
(below). (Coming Soon)id
aka. task/cycle id (the id returned fromsetTimeout()
,setImmediate()
,requestAnimationFrame()
orsetInterval()
)
-
small_cycle
: readonlyobject
Small Cycle
small_cycle
is similar tolarge_cycle
(refer above). (Coming Soon) -
unique_prefix
: readonlystring
Unique Prefix
unique_prefix
passes through toc0reModel
options
-
c0redP(
options (object))
: returnsc0redP instance
Constructor Function
options
contains index keys of the initial set of callbacks. Alloptions
callbacks are both pass throughc0redP.register()
andc0redP.add()
root
(optional) the default 'this' when using ES5function.apply(this,[]);
(first argument infunction.apply
) when used inc0redP.icallback()
.Example:
myc0redP = new c0redP({'init':function(argIn){}, 'destroy':function(argIn){}}, this);
[ x ] init
Suggested not required!
[ x ] ready
Suggested not required!
[ x ] start
Required!
[ x ] exit
Suggested not required!
[ ] bind - (low priority) data-binding