request a series API for message routing #15249
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-obsolete
Closed as the reported issue is no longer relevant
library-isolate
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by @stevehsu77
isolate communication is using port to pass messages between isolates.
and many programmer want to use isolate more convenient as dynamic modules.
but to define and control a protocol for isolates is not so easy.
propose an idea to complete with those. and then treat every isolate as a dynamic module using spwanUri();
isolates <- [router] -> isolates
[router] support follows:
when i implement this. i found some problems.
"targetobject.a.b.c=sourceobject.a.b.c"
or
"targetmap['a']['b']['c']=sourceobject.a.b.c"
the best way is vm provide an router to process this. it can support function call like this
=================================================================================
void setRule(String<or>FieldMirror message_type_field_name,String<or>Regexp message_type_match_regex,[String<or>SendPort source_port,bool condition(Context)<or>Stringclosure script,Result execution(Context)<or>Stringclosure script)
void unsetRule(String<or>FieldMirror message_type_field_name,String<or>Regexp message_type_match_regex)
void attachIsolate(Isolate<or>SendPort child_port)
void detachIsolate(Isolate<or>SendPort child_port)
map routestatus
and then provide bool postMessage(msg) in isolate. return true if isolate is attached to router
================================================================================
i think message router is needed indeed for isolate communication.
reference:
a concept for message routing
https://docs.google.com/file/d/0B0J6sI4o73kvNklPTlJqbV9TaHc/edit
second try to implement the architecture
https://github.com/yuner/surebet
first try to implement the architecture
https://github.com/yunist/yun
The text was updated successfully, but these errors were encountered: