embed mojo shell?

63 views
Skip to first unread message

bche...@gmail.com

unread,
Mar 18, 2016, 4:31:40 AM3/18/16
to mojo-dev
While working on some services for a flutter application, i was thinking i could use mojo inside my own backend to extend it. So my question is howi can today include a mojo shell to excute mojo applications? tHe backend is in erlang so i am thinking to also write the glue code for it. Where should i look for it?

- benoit

Adam Barth

unread,
Mar 18, 2016, 11:38:25 AM3/18/16
to bche...@gmail.com, mojo-dev
On Fri, Mar 18, 2016 at 1:31 AM <bche...@gmail.com> wrote:
While working on some services for a flutter application, i was thinking i could use mojo inside my own backend to extend it. So my question is howi can today include a mojo shell to excute mojo applications? tHe backend is in erlang so i am thinking to also write the glue code for it. Where should i look for it?

You can include your own custom Mojo services in a Flutter application without needing to include the Mojo shell.  Instead, the Flutter engine itself contains a Mojo system implementation that can route messages between services.

Mojo doesn't yet support erlang, although it does support a variety of different languages.  I'm not familiar with erlang, so I'm not sure how much work would be involved in adding support for erlang.  If you look in https://github.com/domokit/mojo/tree/master/mojo/public you can get a sense for what's required to bind Mojo to a new language.

Adam

Benoit Chesneau

unread,
Mar 18, 2016, 11:41:42 AM3/18/16
to Adam Barth, mojo-dev
On Fri, Mar 18, 2016 at 4:38 PM Adam Barth <aba...@chromium.org> wrote:
On Fri, Mar 18, 2016 at 1:31 AM <bche...@gmail.com> wrote:
While working on some services for a flutter application, i was thinking i could use mojo inside my own backend to extend it. So my question is howi can today include a mojo shell to excute mojo applications? tHe backend is in erlang so i am thinking to also write the glue code for it. Where should i look for it?

You can include your own custom Mojo services in a Flutter application without needing to include the Mojo shell.  Instead, the Flutter engine itself contains a Mojo system implementation that can route messages between services.

I know about flutter, my question was more about adding the routing support  to another application, ie registering the server and application parts and set pipes between them. I am trying to find my way in the mojo repo to do it.

Mojo doesn't yet support erlang, although it does support a variety of different languages.  I'm not familiar with erlang, so I'm not sure how much work would be involved in adding support for erlang.  If you look in https://github.com/domokit/mojo/tree/master/mojo/public you can get a sense for what's required to bind Mojo to a new language.


Thanks, I am looking at it :)

Best,

- benoôt 
Adam

Viet-Trung Luu

unread,
Mar 18, 2016, 11:45:09 AM3/18/16
to Adam Barth, bche...@gmail.com, mojo-dev
In particular under public/<language>, you'll find the "library" support for <language>, and under public/tools/bindings/generators/mojom_<language>_generator.py (and public/tools/bindings/generators/<language>_templates) you'll find the required code generation support for <language>.

We're working on making the code generator support more modular/maintainable/extensible (it's currently pretty messy).


Adam

--
You received this message because you are subscribed to the Google Groups "mojo-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojo-dev+u...@chromium.org.

Adam Barth

unread,
Mar 18, 2016, 11:48:06 AM3/18/16
to Benoit Chesneau, mojo-dev
On Fri, Mar 18, 2016 at 8:41 AM Benoit Chesneau <bche...@gmail.com> wrote:
On Fri, Mar 18, 2016 at 4:38 PM Adam Barth <aba...@chromium.org> wrote:
On Fri, Mar 18, 2016 at 1:31 AM <bche...@gmail.com> wrote:
While working on some services for a flutter application, i was thinking i could use mojo inside my own backend to extend it. So my question is howi can today include a mojo shell to excute mojo applications? tHe backend is in erlang so i am thinking to also write the glue code for it. Where should i look for it?

You can include your own custom Mojo services in a Flutter application without needing to include the Mojo shell.  Instead, the Flutter engine itself contains a Mojo system implementation that can route messages between services.

I know about flutter, my question was more about adding the routing support  to another application, ie registering the server and application parts and set pipes between them. I am trying to find my way in the mojo repo to do it.

Ah, I understand.  You want to embed a Mojo system implementation in your own application.  Here's the relevant code:


The first adds a dependency to //mojo/edk/system, which is the code that implements message pipes, data pipes, etc.  The second initializes the Mojo system.  The initialization shown on that line uses the default values, but you there are various options depend on whether you want to run in a single process or multiple processes, etc.

Adam
Reply all
Reply to author
Forward
0 new messages