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

Idea: Support progressive calls via rx Observable<> #238

Open
Jopie64 opened this issue Feb 9, 2018 · 1 comment
Open

Idea: Support progressive calls via rx Observable<> #238

Jopie64 opened this issue Feb 9, 2018 · 1 comment

Comments

@Jopie64
Copy link

Jopie64 commented Feb 9, 2018

Hi,

In our apps based on WampSharp, we want to make use of progressive calls and cancellation. In fact we want to use the cold observable paradigm, and think that progressive result procedures would closely match this paradigm. (The hot observable paradigm is already implemented via Wamp pubsub and already uses Observables in WampSharp).
In WampSharp this is currently implemented via Task CancellationToken and the IProgress interface.
But rx Observables have intrinsic cancellation and progress.

It would be nice to, instead of writing an interface like this:

    [WampProgressiveResultProcedure]
    [WampProcedure("com.myapp.longop")]
    public async Task<int> LongCancellableOp(int n, IProgress<int> progress, CancellationToken token)

as mentioned here: http://wampsharp.net/release-notes/wampsharp-v1.2.6.41-beta-release-notes/

To also be able to write it as this:

    [WampObservableProcedure("com.myapp.longop")]
    public Observable<int> LongCancellableOp(int n)

So the procedure is started when the Observable<> is subscribed (not when the LongCancellableOp() method is called), and is cancelled when the IDisposable is disposed. When the final result appears, OnNext() is called one more time and then OnComplete().

We want to implement it like this anyway, but would it an idea to make this a feature of WampSharp too?

@darkl
Copy link
Member

darkl commented Feb 9, 2018 via email

Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Feb 26, 2021
Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Feb 28, 2021
When subscribed to it will call a progressive RPC

Code-Sharp#238
Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Feb 28, 2021
When subscribed to it will call a progressive RPC

Code-Sharp#238
Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Mar 1, 2021
When subscribed to it will call a progressive RPC

Code-Sharp#238
Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Mar 2, 2021
When subscribed to it will call a progressive RPC

Code-Sharp#238
Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Mar 2, 2021
When subscribed to it will call a progressive RPC

Code-Sharp#238
Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Mar 3, 2021
When subscribed to it will call a progressive RPC

Code-Sharp#238
Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Mar 3, 2021
Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Mar 5, 2021
Jopie64 pushed a commit to Jopie64/WampSharp that referenced this issue Mar 5, 2021
As discussed in the review, this extra declaration is a requirement to
make sure that people really want the method to be progressive and not
return a IObservable derived type by accident.

Code-Sharp#238
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants