comparison src/luan/modules/ThreadLuan.java @ 1302:5345466fa61f

fix last commit and improve stringify
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 13 Jan 2019 17:28:57 -0700
parents a9cc35c71eb0
children 70eecde81820
comparison
equal deleted inserted replaced
1301:a9cc35c71eb0 1302:5345466fa61f
67 } else if( repeating.equals("with_fixed_delay") ) { 67 } else if( repeating.equals("with_fixed_delay") ) {
68 sf = scheduler.scheduleWithFixedDelay(r,delay,delay,TimeUnit.MILLISECONDS); 68 sf = scheduler.scheduleWithFixedDelay(r,delay,delay,TimeUnit.MILLISECONDS);
69 } else if( repeating.equals("at_fixed_rate") ) { 69 } else if( repeating.equals("at_fixed_rate") ) {
70 sf = scheduler.scheduleAtFixedRate(r,delay,delay,TimeUnit.MILLISECONDS); 70 sf = scheduler.scheduleAtFixedRate(r,delay,delay,TimeUnit.MILLISECONDS);
71 } else { 71 } else {
72 throw new LuanException("repeat must be nil or 'with_fixed_delay' or 'at_fixed_rate'"); 72 throw new LuanException("repeating must be nil or 'with_fixed_delay' or 'at_fixed_rate'");
73 } 73 }
74 final Closeable c = new Closeable(){public void close(){ 74 final Closeable c = new Closeable(){public void close(){
75 boolean b = sf.cancel(false); 75 boolean b = sf.cancel(false);
76 }}; 76 }};
77 newLuan.registry().put(luan,luan); // prevent gc 77 newLuan.registry().put(luan,luan); // prevent gc