-
Notifications
You must be signed in to change notification settings - Fork 132
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
Make it possible to implement transactions and feeds (aka data driven intents, RPC etc.) via existing FDC3 concepts #372
Comments
I really like this @kriswest. It's simple, achieves the goal, and ties in to existing concepts and operations. It is also independent of app instances, as it should be. |
@kriswest thinking about it, how do we ensure the intent raising app not missing any data in this case? I.e. what if the app using the response channel sends the result before the app sets up a listener? In other words, there is a race condition here as the receiving app does not know the name of the channel before hand, so it can only set up a channel listener after the intent is resolved. |
I'm still thinking on that TBH. Firstly, it is possible to resolve the intent (and return the channel name) before responding on the channel in many cases, also you can get the last context (any or a particular type) with In Finsemble, when you subscribe to our pub/sub topics, you received the current state of the topic immediately (also they are always created with an initial state). It would be convenient if the same were true of channels in FDC3 as that would sidestep this issue neatly (for a single response). The other obvious alternative solution is for the app raising the intent to specify the response channel... Instead of modifying the |
This is so wrong, that I wrote a blog about it two years ago. Kris, you are basically saying that any form of interop can be created once you have the equivalent of Pub/Sub. This is a true statement, which those of us who remember the TBCO Market Data system lived with for years. in your case you are replacing the concept of a message subject in pub/sub with a named Context, but the problem still remains. If you want to offer a reliable service like feeds, then define an API for Streaming, and then leave it to the implementation to deliver it. Once you try and define it 'exchange these kind of messages over Pub/Sub' it always eventually fails. And of course, as you say the Plexus API contains a set of methods to support streaming, which deal with concepts like late joiners to a stream and recovery from overload. If Transactions or Fees belong in FDC3 then let's define a functional interface for them, and leave the implementation of it in the FDC3 implementation aka Desktop Agent |
Hey @lspiro-Tick42 I'm struggling to see how most of the issues you raise in that article apply to this situation or are not already handled by the proposal - particularly as we're not proposing to use pre-shared topics, rather the responder is determining the topic and would (for example for a transaction) generate a new channel name allowing it to differentiate responses to different requests. Further, channels are not purely pub/sub topics, they are intended to allow for a stream of messages. That said - I do personally prefer Finsemble's approach to a transactional model (the query responder) where a response function is passed in with the query and handles routing of the response back to the requester when called. There are no synchronisation issues - although a stream of responses is not supported. That said, I think there are big advantages to keeping the surface area of and the number of concepts in FDC3 down to a minimum. I am firmly of the belief that both feeds and transactions are relevant concepts to FDC3 and if not handled by the standard will be built using it anyway. This issue is not yet a concrete proposal/PR - it was however intended to stimulate further discussion on the topic so lets keep this going and perhaps work through some specific problem scenarios or alternative proposals. |
@kriswest on the plus side, we both agree that Transactions and Feeds are relevant concepts to FDC3. If we agree that in terms of architecture, using named (and typically private) channel, whose name is returned by some method, is the same design pattern as using Pub/Sub messaging with a last value cache, then the analysis I wrote about the problems we typically see when people try and implement request/response over Pub/Sub are a guide to issues we are likely to see when attempting to implement Transactions using Intents with Private channels. |
@lspiro-Tick42 I think where our thinking differs is on who names the channel. Regarding the relevance of your blog post: If the name of the channel is predetermined or reused then that would give rise to issues 1, 3, 4 & 10. 2 (method detection) is (in part) dealt with by the desktop agent's ability to use a resolver, although you have to know the intents available already which is now dealt with by If you foresee other potential issues could you walk us through how they arise so that we can refine the proposal or documentation to explicitly deal with them? My only actual concern with this proposal is how to deal with the synchronization issue. I think the most elegant approach to that would be to specify that if a listener is added to channel that already has a context (of the relevant type if a type filter was specified) then the handler should be called with it immediately, this would negate the need for the developer to call |
We have a refinement to the proposal for this that will deal with the race condition (without changing the behaviour of channel context handlers - although I think it's a valid change to call them immediately if there is an existing context). I'll add it to the thread next week when we've sense checked it this end. |
Superceded by #432 (for transactions/intents that return data) |
Superceded by #433 (for feeds) |
Enhancement Request
There are many use-cases for (and a number of past discussions held and issues raised about) making it possible to return data from a raised intent, e.g. Issues #201 #203 and PR #287. There are two competing proposals currently (use the AppInstances concept introduced in #287 or merge large parts of the Plexus specification into FDC3). Both proposals introduce new concepts into FDC3 that add to its complexity significantly and, in the case of AppInstances, are counter-intuitive and/or flawed (see review comments on #287).
However, there exists a desire to keep FDC3 as simple as possible to both understand and implement - it is believed that this property has been whats lead to the relative success of the FDC3 standard thus far. Solutions to (asynchronously) returning data from raised intents are possible using the 'channels' concept and API that already exists in FDC3 and only a minor modification to
raiseIntent
's return typeIntentResolution
.This would be achieved by having apps that wish to return data respond with a channel name, on which they will return either a single or stream of responses. By allowing the app handling the response to control the name of the response channel the developer can determine whether to generate a new channel for a response (e.g. to tie it to a particular intent response or transaction, e.g. for the creation of an order and return of a specific ID) or reuse an existing one (e.g. for returning a pricing feed, that could be consumed by multiple other apps).
Use Case:
Proposed modification:
Update the definitions IntentResolution and ContextHandler to support the return of a channel name on which a response may be returned.
Current definitions
Proposed modifications
When calling a context handler for an intent, a Desktop Agent implementation will be expected to check the return type of the handler function and if a string is found, use it to populate the channel name. Most context handlers will be implemented as some form of async function and should be able to return immediately with a channel name (or null if no data will be returned on a channel), before continuing to process the intent and potentially send back results on the indicated channel.
Other ways of returning a channel name from an intent listener may be possible and/or preferable and should be discussed with the Standards Working Group.
The text was updated successfully, but these errors were encountered: