Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Commit

Permalink
chore: release preparations
Browse files Browse the repository at this point in the history
  • Loading branch information
tribal-tec committed Jan 18, 2019
1 parent fe40748 commit 3ad948e
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerBinding: false
DerivePointerBinding: true
ExperimentalAutoDetectBinPacking: false
#FixNamespaceComments: false # uncomment since clang-format 5.0
IndentCaseLabels: false
Expand Down
6 changes: 0 additions & 6 deletions .gitreview

This file was deleted.

5 changes: 1 addition & 4 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ The following people have contributed to Rockets:

Raphael Dumusc
Daniel Nachbaur
Stefan Eilemann
Juan Hernando
Grigori Chevtchenko
John Biddiscombe
Roland Groza
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017-2018, EPFL/Blue Brain Project
# Copyright (c) 2017-2019, EPFL/Blue Brain Project
# [email protected]
#
# This file is part of Rockets <https://github.com/BlueBrain/Rockets>
Expand All @@ -17,7 +17,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(Rockets VERSION 0.1.0)
project(Rockets VERSION 1.0.0)
set(Rockets_VERSION_ABI 1)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/common)
Expand All @@ -28,13 +28,20 @@ endif()
set(ROCKETS_DEB_DEPENDS libboost-test-dev libwebsockets-dev libuv1-dev)
set(ROCKETS_PORT_DEPENDS libwebsockets)

# disable noisy warnings from ChoosePython
set(CHOOSE_PYTHON_DONE ON)
include(FindBoostConfig)

include(Common)

set(ROCKETS_DESCRIPTION "Rockets - REST and websockets C++ library")
set(ROCKETS_MAINTAINER "Blue Brain Project <[email protected]>")
set(ROCKETS_LICENSE LGPL)

common_find_package(Boost SYSTEM COMPONENTS unit_test_framework)
if(APPLE)
common_find_package(OpenSSL REQUIRED) # libwebsockets depends on that
endif()
common_find_package(Libwebsockets SYSTEM)
if(NOT Libwebsockets_FOUND) # Ubuntu package only has libwebsockets.pc
common_find_package_disable(Libwebsockets)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Rockets - a cross-platform library to add REST and websockets interface to C++ a

Rockets is licensed under the LGPL version 3, unless noted otherwise, e.g., for external dependencies. See file COPYING.txt for the full license. External dependencies are either LGPL or BSD-licensed. See file ACKNOWLEDGEMENTS.txt and AUTHORS.txt for further details.

Copyright (C) 2017, Blue Brain Project and AUTHORS.txt
Copyright (C) 2017-2019, Blue Brain Project and AUTHORS.txt

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation.

Expand Down
94 changes: 68 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,36 @@

* [Features](#features)
* [Build](#build)
* [Clients](#clients)
* [Usage](#usage)
* [Contribute](#contribute)


### Features
------------
It provides the following features:
## Features
`Rockets` provides the following features:

* HTTP server with integrated websockets support
* HTTP client for making simple asynchronous requests (with or without payload)
* Websockets client for sending, broadcasting and receiving text and binary
messages
* [HTTP server](rockets/server.h) with integrated websockets support
* [HTTP client](rockets/http/client.h) for making simple asynchronous requests (with or without payload)
* [Websockets client](rockets/ws/client.h) for sending, broadcasting and receiving text and binary messages
* Support for [JSON-RPC](https://www.jsonrpc.org) as a communication protocol over HTTP and websockets. `Rockets` extends the [2.0 specification](https://www.jsonrpc.org/specification) by providing support for [Cancellation and Progress notifications](rockets/jsonrpc/cancellableReceiver.h) of pending requests.
* [Server](rockets/jsonrpc/server.h)
* [C++ client](rockets/jsonrpc/client.h)
* [Javascript client](js/README.md)
* [Python client](python/README.md)
* Event loop integration for [Qt](rockets/qt) and `libuv` through the appropriate `Server` constructor


### Build
---------
Rockets is a cross-platform library designed to run on any modern operating
system, including all Unix variants. It requires a C++11 compiler and uses CMake
to create a platform specific build environment. The following platforms and
build environments are tested:
## Build
`Rockets` is a cross-platform library designed to run on any modern operating system, including all Unix variants.
It requires a C++11 compiler and uses CMake to create a platform specific build environment.
The following platforms and build environments are tested:

* Linux: Ubuntu 16.04, RHEL 6.8
* Mac OS X: 10.9
* Linux: Ubuntu 16.04, 18.04
* Mac OS X: 10.9 - 10.14

Rockets requires the following external, pre-installed dependencies:
`Rockets` requires the following external, pre-installed dependencies:

* libwebsockets
* Boost (for unit tests)
* [libwebsockets](https://libwebsockets.org/)
* [Boost.test](https://www.boost.org/doc/libs/1_69_0/libs/test/doc/html/index.html) (for unit tests)

Building from source is as simple as:
```shell
Expand All @@ -48,16 +50,56 @@ ninja
```


### Clients
-----------
Rockets provides client libraries for the following languages:
## Usage

* [Python](./python/README.md)
* [JavaScript](./js/README.md)
### Hello world REST server
```cpp
#include <rockets/server.h>
#include <iostream>

int main(int , char** )
{
rockets::Server server;
std::cout << "Rockets REST server running on " << server.getURI() << std::endl;

### Contribute
--------------
server.handle(rockets::http::Method::GET, "hello", [](auto) {
return rockets::http::make_ready_response(rockets::http::Code::OK, "world");
});
for(;;)
server.process(100);
return 0;
}
```
### Hello world websockets server
```cpp
#include <rockets/server.h>
#include <iostream>
int main(int , char** )
{
rockets::Server server("", "myws");
std::cout << "Rockets websockets server running on " << server.getURI() << std::endl;
server.handleText([](const auto& request) {
return "server echo: " + request.message;
});
for(;;)
server.process(100);
return 0;
}
```

### Production REST server example

For a more elaborate use of a `Rockets` REST server, check out the [RestServer](https://github.com/BlueBrain/Tide/blob/master/tide/master/rest/RestServer.h) of [Tide](https://github.com/BlueBrain/Tide).

### Production websockets server example

For a more elaborate use of a `Rockets` websockets server, check out the [RocketsPlugin](https://github.com/BlueBrain/Brayns/blob/master/plugins/Rockets/RocketsPlugin.cpp) of [Brayns](https://github.com/BlueBrain/Brayns).


## Contribute
Follow the next guidelines when making a contribution:

* Install our [pre-commit](https://pre-commit.com/#install) hooks with `pre-commit install` prior the first commit
Expand Down
11 changes: 2 additions & 9 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# Changelog {#Changelog}

# git master
## [1.0.0](https://github.com/BlueBrain/Rockets/tree/1.0.0) (2019-01-07)

* [14](https://github.com/BlueBrain/Rockets/pull/14):
Added JSON-RPC 2.0 example applications.
* [9](https://github.com/BlueBrain/Rockets/pull/9):
Added JSON-RPC 2.0 support over HTTP.
* [8](https://github.com/BlueBrain/Rockets/pull/8):
Added JSON-RPC 2.0 parser with client-server over websockets.
* [1](https://github.com/BlueBrain/Rockets/pull/1):
Initial version.
- First release
2 changes: 1 addition & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pip install rockets
---------

#### `Client` vs. `AsyncClient`
Rockets provides to types of clients to support asychronous and synchronous usage.
Rockets provides two types of clients to support asychronous and synchronous usage.

The `AsyncClient` exposes all of its functionality as `async` functions, hence an `asyncio`
[event loop](https://docs.python.org/3/library/asyncio-eventloop.html) is needed to complete pending
Expand Down
8 changes: 4 additions & 4 deletions python/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[metadata]
version = 0.1.0-dev0
version = 1.0.0
name = rockets
summary = Rockets python client
home-page = https://github.com/BlueBrain/Rockets
url = https://github.com/BlueBrain/Rockets
author = Daniel Nachbaur
author-email = [email protected]
license = LGPLv3
classifier =
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable
License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Operating System :: OS Independent
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Software Development :: Libraries
Topic :: Software Development :: Libraries :: Python Modules
keywords = rockets, websocket, jsonrpc, bbp, BlueBrain
keywords = rockets, websocket, json-rpc, bbp, BlueBrain

[pycodestyle]
max-line-length = 100
Expand Down
2 changes: 1 addition & 1 deletion rockets/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ inline std::string to_string(const lws_callback_reasons reason)
#endif
#endif
#endif
default: return std::string("UNKNOW (") + std::to_string((int)reason) + ")";
default: return std::string("UNKNOWN (") + std::to_string((int)reason) + ")";
}
// clang-format on
}
Expand Down
2 changes: 1 addition & 1 deletion rockets/jsonrpc/clientRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ClientRequest
{
}

size_t _id;
const size_t _id;
std::future<ResponseT> _future;
NotifyFunc _notify;
};
Expand Down
3 changes: 1 addition & 2 deletions scripts/build_lib.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/bin/bash
set -e

export CPATH=$(brew --prefix openssl)/include
export PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig

mkdir $BUILD_TYPE
cd $BUILD_TYPE

cmake -GNinja \
-DCLONE_SUBPROJECTS=ON \
-DCMAKE_INSTALL_PREFIX=$PWD/install \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
..
Expand Down
3 changes: 1 addition & 2 deletions scripts/install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ set -e

brew update
brew outdated cmake || brew upgrade cmake
brew install cppcheck doxygen ninja
brew install libwebsockets openssl
brew install ninja libwebsockets openssl
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ endif()

set(TEST_LIBRARIES ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} Rockets)

list(APPEND LCOV_EXCLUDE '${PROJECT_SOURCE_DIR}/rockets/json.hpp')
include(CommonCTest)

0 comments on commit 3ad948e

Please sign in to comment.