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

feat(docs): Event handling in JS #96

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open

Conversation

akim-bow
Copy link
Contributor

@akim-bow akim-bow commented Feb 6, 2024

Notes for reviewer:

  1. I prefer not to put too much command outputs in docs. Because it effectively makes the doc brittle. If we would change project structure a bit or instead of vite take something else, it will invalidate the doc. That's why i used only necessary output.
  2. Like @boneyard93501 said, advanced-ipfs example doesn't belong here. Agree. I think we can keep the file for some time without actually including it to the doc. If we will create additional section e.g. advanced tutorials, i will put the doc there.

Copy link

vercel bot commented Feb 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fluence-dev-docs ✅ Ready (Inspect) Visit Preview 💬 1 unresolved Feb 26, 2024 8:27am

Copy link
Collaborator

@boneyard93501 boneyard93501 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added some changes to the event-handling-edit repo in the https://github.com/fluencelabs/docs/blob/event-handling-edit/docs/build-mvm/tutorials/js_uses.md file.
please have a look. i think adding the code examples and instructions from what you already ave should be trivial.
i think we can drop the ipfs section for now from this JS chapter.


Fluence Cloud Functions are hosted on distributed peers in the Fluence network waiting to be called. That is, your functions need to be triggered in order to do some work. Event triggers may arise from a multitude of sources ranging from browser click-events to changes in a database column. Regardless of the source, the event needs to trigger the function(s) which, as you already know from the introduction and quickstart chapters, requires Aqua to orchestrate the invocation of your distributed compute function(s).

One way of triggering the orchestration of your function(s) is interactively with the Fluence CLI: `fluence run -f 'your function(args)'`. However, events may require (near) real-time processing which in turn requires the orchestration of your function(s) immediately after the event occurred. Whether this is in the browser or some other application, we need to trigger the appropriate Aqua script from a (embedded) client peer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
One way of triggering the orchestration of your function(s) is interactively with the Fluence CLI: `fluence run -f 'your function(args)'`. However, events may require (near) real-time processing which in turn requires the orchestration of your function(s) immediately after the event occurred. Whether this is in the browser or some other application, we need to trigger the appropriate Aqua script from a (embedded) client peer.
One way of triggering the orchestration of your functions is interactively with the Fluence CLI: `fluence run -f 'your function(args)'`. However, events may require near real-time processing which in turn requires the orchestration of your functions immediately after the event occurred. Whether this is in the browser or some other application, we need to trigger the appropriate Aqua script from a embedded client peer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend not to use the excessive braces like that. There's no semantic advantages in hinting at alternatives (like singular/plural), or may even mislead, but extra syntactic elements get in the way when reading.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to ask @boneyard93501 is there any specific meaning in these braces.

### Motivation
Imagine you've deployed your services to Fluence Network and now wondering how to interact with them, e.g., call Aqua function.

Let's forget about CLI for a minute because CLI relies on the described below event handling process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Let's forget about CLI for a minute because CLI relies on the described below event handling process.
Let's forget about CLI for a minute, because CLI relies on the described below event handling process.

To interact with peers of Fluence network, i.e., to execute an Aqua functions, the "client" has to be a peer.
Such client peers don't have to be publicly accessible or long-running in nature, but they need to follow the protocol.

For this reason, Fluence provides thin and simple client peer for interacting with Fluence network - JS client.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For this reason, Fluence provides thin and simple client peer for interacting with Fluence network - JS client.
For this reason, Fluence provides thin and simple JS client peer for interacting with Fluence network.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client peer could be JS or Python or could be written in any other language


> Make sure you've read ***Getting Started*** and ***Quickstart*** pages.

Fluence Cloud Functions are hosted on distributed peers in the Fluence network waiting to be called. That is, your functions need to be triggered in order to do some work. Event triggers may arise from a multitude of sources ranging from browser click-events to changes in a database column. Regardless of the source, the event needs to trigger the function(s) which, as you already know from the introduction and quickstart chapters, requires Aqua to orchestrate the invocation of your distributed compute function(s).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Fluence Cloud Functions are hosted on distributed peers in the Fluence network waiting to be called. That is, your functions need to be triggered in order to do some work. Event triggers may arise from a multitude of sources ranging from browser click-events to changes in a database column. Regardless of the source, the event needs to trigger the function(s) which, as you already know from the introduction and quickstart chapters, requires Aqua to orchestrate the invocation of your distributed compute function(s).
Fluence Cloud Functions are hosted on distributed peers in the Fluence Network waiting to be called. That is, your functions need to be triggered in order to do some work. Event triggers may arise from a multitude of sources ranging from browser click-events to changes in a database column. Regardless of the source, the event needs to trigger the functions which, as you already know from the introduction and quickstart chapters, requires Aqua to orchestrate the invocation of your distributed compute functions.

Akim and others added 2 commits February 22, 2024 16:37
Co-authored-by: nivedano <26411464+nivedano@users.noreply.github.com>
Co-authored-by: nivedano <26411464+nivedano@users.noreply.github.com>

> Make sure you've read ***Getting Started*** and ***Quickstart*** pages.

Fluence Cloud Functions are hosted on distributed peers in the Fluence network waiting to be called. That is, your functions need to be triggered in order to do some work. Event triggers may arise from a multitude of sources ranging from browser click-events to changes in a database column. Regardless of the source, the event needs to trigger the function(s) which, as you already know from the introduction and quickstart chapters, requires Aqua to orchestrate the invocation of your distributed compute function(s).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

terminology is outdated and needs to be updated through out. see https://github.com/fluencelabs/docs/tree/res-32-glossary.
also, for denver all we need is the concept piece not the tutorial. there is no need and no capacity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too broad comment

  • Which part are you considering tutorial? Exchanging events between clients paragraph?
  • Where exactly does glossary not match?
    I would like to see more details from you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also have kind of events-in-js doc in main branch already and it makes me confused.

Base automatically changed from mvm-version to main February 25, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants