Closed DartBot closed 6 years ago
Not sure why this is marked as a dartium bug, it seems like a more generic Dart library feature request.
Removed Area-Dartium label. Added Area-Library label.
This comment was originally written by @stevehsu77
Sorry about that, it should be the request for not only library but also vm core. i don't know where to post it, would you please move this issue to right please, thanks.
Removed Type-Defect label. Added Type-Enhancement, Library-Isolate labels.
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.
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