1515 */
1616component extends = " ../BaseTask" {
1717
18- /**
19- * Create a future that prints out a greeting immediately.
20- */
21- function partOne () {
22- return ;
23- }
18+ /**
19+ * Create a future that prints out a greeting immediately.
20+ */
21+ function partOne (){
22+ return ;
23+ }
2424
25- /**
26- * Create a future that prints out a greeting after 2 seconds.
27- */
28- function partTwo () {
29- return ;
30- }
25+ /**
26+ * Create a future that prints out a greeting after 2 seconds.
27+ */
28+ function partTwo (){
29+ return ;
30+ }
3131
32- /**
33- * Create a future that _returns_ a message to print out after 5 seconds.
34- * Print out that message on the main thread.
35- */
36- function partThree () {
37- return ;
38- }
32+ /**
33+ * Create a future that _returns_ a message to print out after 5 seconds.
34+ * Print out that message on the main thread.
35+ */
36+ function partThree (){
37+ return ;
38+ }
3939
40- /**
41- * Create a future that _returns_ a message to print out after 5 seconds.
42- * Wait for a 3 second timeout before returning a default value.
43- * Print out that message on the main thread.
44- */
45- function partFour () {
46- return ;
47- }
40+ /**
41+ * Create a future that _returns_ a message to print out after 5 seconds.
42+ * Wait for a 3 second timeout before returning a default value.
43+ * Print out that message on the main thread.
44+ */
45+ function partFour (){
46+ return ;
47+ }
4848
49- /**
50- * Create a future that _returns_ a message to print out after 5 seconds.
51- * Wait for a 3 second timeout. Do not return a default value.
52- * See what happens on the main thread
53- * - when you do not wait for the future to complete?
54- * - when you wait for the future to complete?
55- */
56- function partFive () {
57- return ;
58- }
49+ /**
50+ * Create a future that _returns_ a message to print out after 5 seconds.
51+ * Wait for a 3 second timeout. Do not return a default value.
52+ * See what happens on the main thread
53+ * - when you do not wait for the future to complete?
54+ * - when you wait for the future to complete?
55+ */
56+ function partFive (){
57+ return ;
58+ }
5959
60- function run () {
61- print .blueLine ( " Running all `01-intro-to-futures` exercises" ).toConsole ();
62- print .yellowLine ( " Press Ctrl-C to exit" ).line ().toConsole ();
60+ function run (){
61+ print .blueLine ( " Running all `01-intro-to-futures` exercises" ).toConsole ();
62+ print
63+ .yellowLine ( " Press Ctrl-C to exit" )
64+ .line ()
65+ .toConsole ();
6366
64- partOne ();
65- partTwo ();
66- partThree ();
67- partFour ();
68- partFive ();
67+ partOne ();
68+ partTwo ();
69+ partThree ();
70+ partFour ();
71+ partFive ();
6972
70- while ( true ) {
73+ while ( true ) {
7174 if ( ! isNull ( checkInterrupted () ) ) {
7275 return ;
7376 }
7477 sleep ( 100 );
7578 }
76- }
79+ }
7780
78- }
81+ }
0 commit comments