jdegoes / blueeyes

A lightweight Web 3.0 framework for Scala, featuring a purely asynchronous architecture, extremely high-performance, massive scalability, high usability, and a functional, composable design.
github.com/jdegoes/blueeyes
739 stars 46 forks source link

How to support CoAP? #133

Open tkellogg opened 10 years ago

tkellogg commented 10 years ago

I'd like to explore the possibility of having a web framework support both HTTP and CoAP. How suitable would Blueeyes be to support an extension that handles both CoAP and HTTP requests and responses for the same resources? My idea would be to use Californium as the CoAP implementation. Even though it's written in Java, Californium should be mostly friendly toward being wrapped in a functional style, except for it's pervasive use of mutable data.

CoAP is a RESTful protocol that mirrors a lot of the functionality of HTTP/1.1 but as a compact binary protocol suitable for embedded devices. It runs over UDP, but the Californium implementation takes care of ACKs and resending messages. The biggest incompatibility is the fact that there aren't any custom CoAP headers and many of the normal HTTP headers don't have a CoAP analogy.

I'd like to pursue this, but I want to know your thoughts. Would this be difficult? Is blueeyes a suitable choice for this?

jdegoes commented 10 years ago

RedEyes (AKA BlueEyes 2) would be a better fit for this, as it cleanly separates the specification of an API from its compilation to an executable format (this choice also allows but does not require the use of mutable implementation). The real question is, what would be the benefit? The ability to deploy both an HTTP API and a CoAP API simultaneously, from the same description?

tkellogg commented 10 years ago

Yes, precisely. CoAP endpoints are usually described in similar terms, with methods and URIs. There's a lot of overlap between how you interface with both protocols. Where is the repository for RedEyes?

jdegoes commented 10 years ago

It's not public yet, but it will be at github.com/jdegoes/redeyes/ within the month.