Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request a series API for message routing #15249

Closed
DartBot opened this issue Nov 21, 2013 · 3 comments
Closed

request a series API for message routing #15249

DartBot opened this issue Nov 21, 2013 · 3 comments
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

Comments

@DartBot
Copy link

DartBot commented Nov 21, 2013

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:

  1. recognize message
  2. match route rule [match user-defined properties in message]
  3. check condition [check router status/check message properties]
  4. do execution [change router status/translate message/send message]

when i implement this. i found some problems.

  1. regexp cannot support pre-compile like as c#?
  2. rule for check and do could be generated from string(dart script)
  3. translate message need to check each properties using recursive is to slow.(if vm can support object-to-object clone by rule. or map-to-map clone by rule. rule definition look like this
    "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

@a-siva
Copy link
Contributor

a-siva commented Dec 2, 2013

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.

@DartBot
Copy link
Author

DartBot commented Dec 3, 2013

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.

@lrhn
Copy link
Member

lrhn commented May 5, 2014

Removed Type-Defect label.
Added Type-Enhancement, Library-Isolate labels.

@DartBot DartBot added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-isolate labels May 5, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Feb 29, 2016
@lrhn lrhn added the core-m label Aug 11, 2017
@floitschG floitschG added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. and removed area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-m labels Aug 28, 2017
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

6 participants