#canvas #browser #render #websocket

remote-canvas

An adapter for Browser-based canvas implementations into a Rust application at scale

5 stable releases

1.0.4 Apr 10, 2020
1.0.3 Apr 6, 2020
1.0.2 Mar 31, 2020
1.0.1 Mar 28, 2020
1.0.0 Mar 26, 2020

#853 in Graphics APIs

GPL-3.0-or-later

64KB
2K SLoC

Rust 1.5K SLoC JavaScript 356 SLoC // 0.1% comments

Remote Canvas

An adapter for Browser-based canvas implementations into a Rust application at scale.

Goals

  • Provide a scalable way to use a browser-based Canvas implementation in Rust applications.
  • Take advantage of multiple browsers at the same time
  • Provide a nearly-identical API to 2D context rendering.

Future Goals

  • Provide a nearly-identical API to WebGL context rendering.
  • Integrate with local Chrome install or a Docker cluster of Chrome containers in order to provide a connected browser on demand.

Limitations

  • A browser may disappear at any time which will destroy all attached Canvas' at the API level. It is up to the end user to restart their context.
    • This is intentional as, while tracking the context transactionally to restart it is relatively easy, it may have significant performance issues.
  • Unless load is sufficiently high, only one browser will be used.
    • This is due to the use of async_std's MPMC channel versus a proper load balancing solution.
    • A long term solution may be a load balance job.
  • No browser authentication

Dependencies

~28–41MB
~748K SLoC