Can Reactive Extensions (Rx) be used across process or machine boundaries?

后端 未结 7 1469
名媛妹妹
名媛妹妹 2021-02-08 03:48

Vaguely remember seeing some discussions on this quite a while back but haven\'t heard anything since. So basically are you able to subscribe to an IObservable on a remote machi

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-08 03:59

    Another possible solution could be to use named pipes.

    There is an excellent NuGet package NamedPipeWrapper, see the source on GitHub. It would be easy to write a thin RX wrapper over this, i.e. subscribe to the RX stream and push the messages out to other .NET listening processes using this library.

    As this solution uses named pipes, it would be a true pub/sub solution which would support multiple subscribers in different processes.

    Update

    It is indeed very easy to write simple RX bridge code over the named pipes library. Use an RX Subject and insert the RX bridge code into the event handlers. Its not more than 4 lines of additional code at both ends. I can post the code if anyone is interested.

    Update

    For more information on named pipes, see .NET 3.5 Adds Named Pipes Support and Interprocess Communication Using .NET 3.5 Named Pipes IO. The aforementioned NuGet package NamedPipeWrapper is a much nicer version of the built-in support for named pipes that .NET 3.5 introduced.

提交回复
热议问题