kente678 / funnel

Automatically exported from code.google.com/p/funnel
Other
0 stars 0 forks source link

action-coding stops responding a typo #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run the following code (including a typo: aio)
2. a NoMethodError occurs (this is correct)
3. fix the typo (aio -> ain)
4. press command + 4 to reload

require "funnel"
include Funnel

def setup
  size 400, 400
  @gio = Gainer.new
end

def draw
  background @gio.aio(0).value * 255  # should be 'ain'
end

INFO: Ready to use the action-coding environment
command port: localhost, 54289
Rebooted successfully
Configured successfully
...
Error while running applet.
(eval):10:in `draw': #<NameError::Message:0xae8bac> (NoMethodError)
    from :1
    ...internal jruby stack elided...
(eval):10:in `draw': #<NameError::Message:0xae8bac> (NoMethodError)
    from :1
    ...internal jruby stack elided...
command port: localhost, 54293

What is the expected output? What do you see instead?
The error should be fixed at step 4, but the applet stops responding.
ステップ4でエラーは修正されるはずだが、アプレットの反�
��が停止してしまう。場
合によってはメニューやcommand + 
qでの終了ができず、強制終了が必要になる。

Please use labels and text to provide additional information.
r419
action-coding: r91
Mac OS X 10.5.4
JRuby 1.1.3
Processing 0135

Original issue reported on code.google.com by kotob...@gmail.com on 9 Aug 2008 at 1:51

GoogleCodeExporter commented 8 years ago
The simple class with dispose method works as expected. So this bug should be 
not in
action-coding side but in Funnel library side.

def setup
 size 200, 200
 frameRate 1
 @hoge = Hoge.new(self)
end

def draw
 @hoge.fugo #typo
end

if defined? IRP then
 begin
   # Load action-coding related libraries
   require 'java'
   require 'rplib.jar'
   include_class 'processing.core.PApplet'
   include_class 'IPAppletAdapter'
   puts "INFO: Ready to use the action-coding environment"
 rescue LoadError
   # It seems that action-coding environment is not available
 end
end

class Hoge
 include IPAppletAdapter if defined? IRP

 def initialize(applet)
   if applet != nil then
     puts applet
     @applet = applet
     @applet.registerDispose(self)
   end
 end

 def fuga
   puts "fuga called"
 end

 def dispose
   puts "INFO: Disposing..."
   sleep 1
   puts "INFO: Disposed!"
 end
end

INFO: Ready to use the action-coding environment
org.jruby.proxy.processing.core.PApplet$Proxy2[panel0,0,0,200x200,invalid,layout
=java.awt.FlowLayout]
Error while running applet.
(eval):8:in `draw': #<NameError::Message:0xf23f8b> (NoMethodError)
       from :1
       ...internal jruby stack elided...
(eval):8:in `draw': #<NameError::Message:0xf23f8b> (NoMethodError)
       from :1
       ...internal jruby stack elided...
INFO: Disposing...
INFO: Disposed!

Original comment by kotob...@gmail.com on 10 Aug 2008 at 1:00

GoogleCodeExporter commented 8 years ago
一部修正:r420

元々のコードがリロード後にどこで停止しているのかにつ��
�て調べたところ、IOSystemのコン
ストラクタ中で/resetコマンドを送信し、その返事を待って��
�る部分であることがわかった。
ここでは、Queue.popのブロックをtimeoutに渡してタイムアウト�
��るようにしていたが、実際
にはタイムアウトは期待したようには動作していなかった��
�そこで、timeoutではなくnon-
blockingでpopするようにして自前の判定ルーチンでタイムアウ
トを処理するようにしたとこ
ろ、少なくともユーザから見て無反応になることはなくな��
�た。

しかし、何故disposeメソッドが呼ばれないのかに関しては相�
��わらず謎である。

Original comment by kotob...@gmail.com on 10 Aug 2008 at 2:23