Is fan possible to hotswap a loaded pod at runtime?
If so, we can rebuild a pod and reload it in runtime, without to restart the application. Most script language support dynamic reload at runtime, i think fan should support such feature.
brianTue 7 Apr 2009
Currently scripts can be reloaded at runtime via Sys.compile, but pods cannot.
When you reload a script it just creates a new pod namespace. This technique works well for things like web pages - you can just change the script and hit refresh in your browser. Assuming no one holds references to the old classes, they are eventually GC'ed.
Pods and classes used by other classes on the other hand can't be hot swapped without JVM or CLR support. I believe Java Rebel allows such a thing, but I have never tried it myself.
wangzaixiangTue 7 Apr 2009
Yes, i see it when i looked at the generated class for a pod. I just think that it would be a very interesting feature if we can reload a pod at runtime, if so, we can develop more interactive, and build a 7*24 system without shutdown the application.
brianTue 7 Apr 2009
If someone wants to play around with trying out a technology like Java Rebel with Fan, I'd be happy to work you. Probably require a bit of changes to Fan's reflection classes.
wangzaixiang Tue 7 Apr 2009
Is fan possible to hotswap a loaded pod at runtime?
If so, we can rebuild a pod and reload it in runtime, without to restart the application. Most script language support dynamic reload at runtime, i think fan should support such feature.
brian Tue 7 Apr 2009
Currently scripts can be reloaded at runtime via
Sys.compile
, but pods cannot.When you reload a script it just creates a new pod namespace. This technique works well for things like web pages - you can just change the script and hit refresh in your browser. Assuming no one holds references to the old classes, they are eventually GC'ed.
Pods and classes used by other classes on the other hand can't be hot swapped without JVM or CLR support. I believe Java Rebel allows such a thing, but I have never tried it myself.
wangzaixiang Tue 7 Apr 2009
Yes, i see it when i looked at the generated class for a pod. I just think that it would be a very interesting feature if we can reload a pod at runtime, if so, we can develop more interactive, and build a 7*24 system without shutdown the application.
brian Tue 7 Apr 2009
If someone wants to play around with trying out a technology like Java Rebel with Fan, I'd be happy to work you. Probably require a bit of changes to Fan's reflection classes.