An open-source project by Facebook has made it as SD Times’ GitHub project of the week. The project is called Wangle, and it is a client/server application framework to build asynchronous, event-driven modern C++ services.
Facebook open-sourced this project last summer, but recently a Facebook software engineer named James Sedgwick wrote some software with Wangle, demonstrating the ways in which it can be used by others.
Wangle is influenced by the JVM-based libraries Netty (a Java network application framework) and Finagle (a Scala RPC system built at Twitter and on top of Netty), according to Sedgwick’s post. It builds on top of two Facebook-developed libraries that provide asynchronous interfaces. These interfaces are live in Folly, which is an open-source C++ library.
This open-source project allows the development of asynchronous and modular servers and clients in C++. It’s also increased performance for Facebook’s other projects, like fbthrift and Proxygen. Other internal projects at Facebook have used Wangle to increase performance.
The fundamental abstraction of Wangle are pipelines. A pipeline is a series of Handlers that intercept inbound or outbound events, giving full control over how events are handled, according to Wangle’s GitHub page.
Services, an advanced version of pipelines, are another important abstraction. A pipeline can offer flexibility in customizing how requests and responses and how they are handled by a service.
According to Wangle’s GitHub page:
“A pipeline is a chain of request/response handlers that handle upstream (handling request) and downstream (handling response). Once you chain handlers together, it provides an agile way to convert a raw data stream into the desired message type (class) and the inverse—desired message type to raw data stream.
A handler should do one and only one function—just like the UNIX philosophy. If you have a handler that is doing more than one function than you should split it into individual handlers. This is really important for maintainability and flexibility as it’s common to change your protocol for one reason or the other.”
Wangle is production grade and is considered stable, but Wangle is ready for any pull requests on its GitHub page.
Top 5 trending projects on GitHub this week
#1: FreeCodeCamp: Still…trending…
#2. F8 App 2016: Source code of the official F8 app of 2016, powered by React Native and other Facebook open source projects.
#3. Nuklear: A small ANSI C GUI toolkit.
#4. Agera: Reactive Programming for Android.
#5. BackgroundMusic: An OS X audio utility with some neat features like per-application volume control.