Skip to content

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

Open
@Jopie64

Description

@Jopie64

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions