Git Product home page Git Product logo

Comments (1)

peterbroadhurst avatar peterbroadhurst commented on May 24, 2024

A more detailed view of how the end-to-end flow works, with an example where the request is not pinned, and the response is pinned.

The blue parts show the code that would otherwise need to be in the application, that is abstracted away by using FireFly with this set of features.

image

Source (sequencediagram.org):

title Sync <-> Async Example: Unpinned request, pinned response

participant "Member1 App\nRequester" as app1
database "FireFly DB" as db1
boundary "FireFly Core\n(Multiparty GW API)" as firefly1
entity "Data\nExchange 1" as dx1

entity "Blockchain" as blockchain

entity "Data\nExchange 2" as dx2
boundary "FireFly Core\n(Multiparty GW Proxy)" as firefly2
database "FireFly DB" as db2
participant "Member2 App\nResponder" as app2

app1->firefly1: POST /call/tag/my-request

activate firefly1 #20639b
activate firefly2 #20639b
firefly1-->firefly1: Sync<->Async\nsetup for reply
firefly1<->db1: Store\n"my-request"\nrequest
group Unpinned request
firefly1->dx1: Send message
dx1-->dx2: Secure private transfer
dx2->firefly2: New message
firefly2<->db2: Store\n"/my-request"\nrequest [EVENT]
end
firefly2<->firefly2: Match subscription\non "webhook"\ntransport
firefly2->app2: POST webhook "/my-request"
deactivate firefly1
deactivate firefly2

group Responder app
app2<->app2: Awesome app\nprocessing
end

app2->firefly2: POST [200]\n(with data)
activate firefly2 #20639b
activate firefly1 #20639b
firefly2<->db2: Store\n"my-response"\nresponse
group Pinned response
firefly2->dx2: Send message
firefly2->blockchain: Pin response\nto blockchain
group The order of these events is non-deterministic
dx2-->dx1: Secure private transfer
dx1-->firefly1: New message
firefly1<-->db1: Interim DB updates 
blockchain-->firefly1: Detect pin
firefly1<-->db1: Interim DB updates 
end
firefly1->firefly1: aggregate pin\nand data
firefly1<->db1: Store confirmed\n"my-response"\nresponse [EVENT]
end
firefly1-->firefly1: Sync<->Async\ncorrelation with\nrequest msg
firefly1->app1: POST [200]\n(with data)
deactivate firefly2
deactivate firefly1

from firefly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.