7
7
// Requirements: Total.js +v2.3.0
8
8
require ( 'total.js' ) . load ( 'debug' , [ 'models' , 'workflows' ] ) ;
9
9
10
- // Async list
11
- var samples = [ ] ;
12
-
13
- // Empty instance of User
14
- var user = CREATE ( 'User' ) ;
15
-
16
- samples . push ( function ( next ) {
17
- console . log ( '---> begin $exec("user-save")' ) ;
18
- user . $exec ( 'user-save' , function ( err , response ) {
19
- console . log ( '---> end $exec("user-save") RESPONSE: ' + JSON . stringify ( response ) ) ;
20
- console . log ( ) ;
21
- next ( ) ;
10
+ setTimeout ( function ( ) {
11
+
12
+ // Async list
13
+ var samples = [ ] ;
<
10000
code>14 +
15
+ // Empty instance of User
16
+ var user = CREATE ( 'User' ) ;
17
+
18
+ samples . push ( function ( next ) {
19
+ console . log ( '---> begin $exec("user-save")' ) ;
20
+ user . $exec ( 'user-save' , function ( err , response ) {
21
+ console . log ( '---> end $exec("user-save") RESPONSE: ' + JSON . stringify ( response ) ) ;
22
+ console . log ( ) ;
23
+ next ( ) ;
24
+ } ) ;
25
+ } ) ;
26
+
27
+ samples . push ( function ( next ) {
28
+ console . log ( '---> begin $exec("array-results")' ) ;
29
+ user . $exec ( 'array-results' , function ( err , response ) {
30
+ console . log ( '---> end $exec("array-results") RESPONSE: ' + JSON . stringify ( response ) ) ;
31
+ console . log ( ) ;
32
+ next ( ) ;
33
+ } ) ;
22
34
} ) ;
23
- } ) ;
24
-
25
- samples . push ( function ( next ) {
26
- console . log ( '---> begin $exec("array-results")' ) ;
27
- user . $exec ( 'array-results' , function ( err , response ) {
28
- console . log ( '---> end $exec("array-results") RESPONSE: ' + JSON . stringify ( response ) ) ;
29
- console . log ( ) ;
30
- next ( ) ;
35
+
36
+ samples . push ( function ( next ) {
37
+ console . log ( '---> begin $exec("user-query")' ) ;
38
+ user . $exec ( 'user-query' , function ( err , response ) {
39
+ console . log ( '---> end $exec("user-query") RESPONSE: ' + JSON . stringify ( response ) ) ;
40
+ console . log ( ) ;
41
+ next ( ) ;
42
+ } ) ;
31
43
} ) ;
32
- } ) ;
33
-
34
- samples . push ( function ( next ) {
35
- console . log ( '---> begin $exec("user-query")' ) ;
36
- user . $exec ( 'user-query' , function ( err , response ) {
37
- console . log ( '---> end $exec("user-query") RESPONSE: ' + JSON . stringify ( response ) ) ;
38
- console . log ( ) ;
39
- next ( ) ;
44
+
45
+ samples . push ( function ( next ) {
46
+ console . log ( '---> begin $exec("xml")' ) ;
47
+ user . $exec ( 'xml' , function ( err , response ) {
48
+ console . log ( '---> end $exec("xml") RESPONSE: ' + JSON . stringify ( response ) ) ;
49
+ console . log ( ) ;
50
+ next ( ) ;
51
+ } ) ;
40
52
} ) ;
41
- } ) ;
42
-
43
- samples . push ( function ( next ) {
44
- console . log ( '---> begin $exec("xml")' ) ;
45
- user . $exec ( 'xml' , function ( err , response ) {
46
- console . log ( '---> end $exec("xml") RESPONSE: ' + JSON . stringify ( response ) ) ;
47
- console . log ( ) ;
48
- next ( ) ;
53
+
54
+ samples . async ( function ( ) {
55
+ // Kills the app
56
+ F . kill ( ) ;
49
57
} ) ;
50
- } ) ;
51
58
52
- samples . async ( function ( ) {
53
- // Kills the app
54
- F . kill ( ) ;
55
- } ) ;
59
+ } , 1000 ) ;
0 commit comments