All Projects → borchero → Squid

borchero / Squid

Licence: mit
Declarative and Reactive Networking for Swift.

Programming Languages

swift
15916 projects
declarative
70 projects

Projects that are alternatives of or similar to Squid

Simple Vpn
A simple VPN allowing mesh-like communication between nodes, over websockets
Stars: ✭ 201 (+229.51%)
Mutual labels:  networking, websockets
Javawebsocketclient
RxJava WebSocket library for Java and Android
Stars: ✭ 188 (+208.2%)
Mutual labels:  reactive, websockets
Webfluxtemplate
Spring Webflux template application with working Spring Security, Web-sockets, Rest, Web MVC, and Authentication with JWT.
Stars: ✭ 107 (+75.41%)
Mutual labels:  reactive, websockets
Lance
Multiplayer game server based on Node.JS
Stars: ✭ 1,161 (+1803.28%)
Mutual labels:  networking, websockets
Colyseus
⚔ Multiplayer Framework for Node.js
Stars: ✭ 3,817 (+6157.38%)
Mutual labels:  networking, websockets
Colyseus Examples
Colyseus Game Server examples for learning purposes
Stars: ✭ 109 (+78.69%)
Mutual labels:  networking, websockets
Siesta
The civilized way to write REST API clients for iOS / macOS
Stars: ✭ 2,142 (+3411.48%)
Mutual labels:  reactive, networking
Facil.io
Your high performance web application C framework
Stars: ✭ 1,393 (+2183.61%)
Mutual labels:  networking, websockets
Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (+5213.11%)
Mutual labels:  networking, websockets
crypto-websocket-extensions
🧰 Unified and optimized data structures across cryptocurrency exchanges
Stars: ✭ 31 (-49.18%)
Mutual labels:  reactive, websockets
Spec
The AsyncAPI specification allows you to create machine-readable definitions of your asynchronous APIs.
Stars: ✭ 1,860 (+2949.18%)
Mutual labels:  reactive, websockets
Humblenet
a cross-platform networking library that works in the browser
Stars: ✭ 515 (+744.26%)
Mutual labels:  networking, websockets
Django Sockpuppet
Build reactive applications with the django tooling you already know and love.
Stars: ✭ 225 (+268.85%)
Mutual labels:  reactive, websockets
Ntex
framework for composable networking services
Stars: ✭ 381 (+524.59%)
Mutual labels:  networking, websockets
Carrot
🥕 Build multi-device AR applications
Stars: ✭ 32 (-47.54%)
Mutual labels:  networking, websockets
Ipfsfb
InterPlanetary File System for Business (IPFSfB) is an enterprise blockchain storage network based on InterPlanetary File System.
Stars: ✭ 57 (-6.56%)
Mutual labels:  networking
Wsdirector
All the world's a server, and all the men and women merely clients
Stars: ✭ 58 (-4.92%)
Mutual labels:  websockets
Aws Pagination Rules
The rules for pagination in AWS SDKs
Stars: ✭ 57 (-6.56%)
Mutual labels:  pagination
React Grid Table
A modular table, based on a CSS grid layout, optimized for customization.
Stars: ✭ 57 (-6.56%)
Mutual labels:  pagination
Netmap Tutorial
Netmap tutorial at SIGCOMM 2017 and AsiaBSDCon 2018
Stars: ✭ 60 (-1.64%)
Mutual labels:  networking

Squid

Cocoapods Build CocoaPods Documentation

Squid is a declarative and reactive networking library for Swift. Developed for Swift 5, it aims to make use of the latest language features. The framework's ultimate goal is to enable easy networking that makes it easy to write well-maintainable code.

In its very core, it is built on top of Apple's Combine framework and uses Apple's builtin URL loading system for networking.

Features

At the moment, the most important features of Squid can be summarized as follows:

  • Sending HTTP requests and receiving server responses.
  • Retrying HTTP requests with a wide range of retriers.
  • Automated requesting of new pages for paginated HTTP requests.
  • Sending and receiving messages over WebSockets.
  • Abstraction of API endpoints and security mechanisms for a set of requests.

Quickstart

When first using Squid, you might want to try out requests against a Test API.

To perform a sample request at this API, we first define an API to manage its endpoint:

struct MyApi: HttpService {

    var apiUrl: UrlConvertible {
        "jsonplaceholder.typicode.com"
    }
}

Afterwards, we can define the request itself:

struct Todo: Decodable {

    let userId: Int
    let id: Int
    let title: String
    let completed: Bool
}

struct TodoRequest: JsonRequest {

    typealias Result = Todo
    
    let id: Int
    
    var routes: HttpRoute {
        ["todos", id]
    }
}

And schedule the request as follows:

let api = MyApi()
let request = TodoRequest(id: 1)

// The following request will be scheduled to `https://jsonplaceholder.typicode.com/todos/1`
request.schedule(with: api).ignoreError().sink { todo in 
    // work with `todo` here
}

Installation

Squid is available via the Swift Package Manager as well as CocoaPods.

Swift Package Manager

Using the Swift Package Manager is the simplest option to use Squid. In Xcode, simply go to File > Swift Packages > Add Package Dependency... and add this repository.

If you are developing a Swift package, adding Squid as a dependency is as easy as adding it to the dependencies of your Package.swift like so:

dependencies: [
    .package(url: "https://github.com/borchero/Squid.git")
]

CocoaPods

If you are still using CocoaPods or are required to use it due to other dependencies that are not yet available for the Swift Package Manager, you can include the following line in your Podfile to use the latest version of Squid:

pod 'Squid'

Documentation

Documentation is available here and provides both comprehensive documentation of the library's public interface as well as a series of guides teaching you how to use Squid to great effect. Expect more guides to be added shortly.

License

Squid is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].