A
Alexey Petrushin
Hello!
IN SHORT (by some example):
There is a web application, and two 'pages' - 'View' and 'Editor'. And
when i press 'Edit' button on the 'View' it should:
- Freeze current execution (callcc {bla-bla})
- Give control to 'Editor'
- User fill data in 'Editor'
- 'Editor' return entered data and control back to 'List'
(continuation.call data)
- Friezed execution resumes
THE PROBLEM:
I implement this the same way as in Seaside, and it seems to should
works, but it throws:
"Caught RuntimeError: continuation called across threads"
Probably, because WebServer runs each request in a new thread. Do you
hawe any idea how this can be solved?
Thanks!
DETAILS:
In pseudo code:
class Editor < Form
def initialize
data = TextField.new self, ''
FormButton.new(self, 'Save') {answer data.text}
end
end
class View < Panel
def initialize editor
view= Label.new self, 'Some initial value ...'
Button.new(self, 'Edit') {view.text = call(editor)}
end
end
class MySuperApp < Panel
def initialize
View.new(self, Editor.new)
end
end
IN SHORT (by some example):
There is a web application, and two 'pages' - 'View' and 'Editor'. And
when i press 'Edit' button on the 'View' it should:
- Freeze current execution (callcc {bla-bla})
- Give control to 'Editor'
- User fill data in 'Editor'
- 'Editor' return entered data and control back to 'List'
(continuation.call data)
- Friezed execution resumes
THE PROBLEM:
I implement this the same way as in Seaside, and it seems to should
works, but it throws:
"Caught RuntimeError: continuation called across threads"
Probably, because WebServer runs each request in a new thread. Do you
hawe any idea how this can be solved?
Thanks!
DETAILS:
In pseudo code:
class Editor < Form
def initialize
data = TextField.new self, ''
FormButton.new(self, 'Save') {answer data.text}
end
end
class View < Panel
def initialize editor
view= Label.new self, 'Some initial value ...'
Button.new(self, 'Edit') {view.text = call(editor)}
end
end
class MySuperApp < Panel
def initialize
View.new(self, Editor.new)
end
end