Fencible

Properties

2
isFencible: Boolean= truereadonly
Identifies an object as an instance of Fencible class, or subclass thereof.
isFencible: Boolean= truereadonlystatic
Identifies an object as an instance of Fencible class, or subclass thereof.

Typedefs

1

A description of how to protect a method from reentry.

A value of true is transformed using the key as the all value. For example, this:

 class Foo extends Base.mixin(Fencible) {
     static fenced = {
         foo : true
     };

Is equivalent to this:

 class Foo extends Base.mixin(Fencible) {
     static fenced = {
         foo : {
             all : ['foo']
         }
     };

Strings are split on spaces to produce the all array. For example, this:

 class Foo extends Base.mixin(Fencible) {
     static fenced = {
         foo : 'foo bar'
     };

Is equivalent to this:

 class Foo extends Base.mixin(Fencible) {
     static fenced = {
         foo : {
             all : ['foo', 'bar']
         }
     };

This indicates that foo() cannot be reentered if foo() or bar() are already executing. On entry to foo(), both foo() and bar() will be fenced (prevented from entering).

ParameterTypeDescription
allString | String[]

One or more keys that must all be currently unlocked to allow entry to the fenced method. String values are converted to an array by splitting on spaces.

anyString | String[]

One or more keys of which at least one must be currently unlocked to allow entry to the fenced method. String values are converted to an array by splitting on spaces.

lockString | String[]

One or more keys that will be locked on entry to the fenced method and released on exit. String values are converted to an array by splitting on spaces. By default, this array includes all keys in all and any.