Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roadrunner-server/goridge
🧙 High-performance PHP-to-Golang IPC/RPC bridge
https://github.com/roadrunner-server/goridge
golang golang-ipc-bridge performance-php php pipes rpc servercodec socket tcp unix
Last synced: about 16 hours ago
JSON representation
🧙 High-performance PHP-to-Golang IPC/RPC bridge
- Host: GitHub
- URL: https://github.com/roadrunner-server/goridge
- Owner: roadrunner-server
- License: mit
- Created: 2017-08-13T15:34:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-11T23:04:16.000Z (2 months ago)
- Last Synced: 2024-10-29T15:48:56.844Z (about 1 month ago)
- Topics: golang, golang-ipc-bridge, performance-php, php, pipes, rpc, servercodec, socket, tcp, unix
- Language: Go
- Homepage:
- Size: 3.07 MB
- Stars: 1,234
- Watchers: 43
- Forks: 78
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- go-awesome - goridge - High performance PHP to Golang IPC bridge (Open source library / Interpreter)
README
High-performance PHP-to-Golang IPC bridge
=================================================
[![GoDoc](https://godoc.org/github.com/roadrunner-server/goridge/v3?status.svg)](https://godoc.org/github.com/roadrunner-server/goridge/v3)
![Linux](https://github.com/roadrunner-server/goridge/workflows/Linux/badge.svg)
![macOS](https://github.com/roadrunner-server/goridge/workflows/MacOS/badge.svg)
![Windows](https://github.com/roadrunner-server/goridge/workflows/Windows/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/spiral/goridge)](https://goreportcard.com/report/github.com/spiral/goridge)
[![Codecov](https://codecov.io/gh/roadrunner-server/goridge/branch/master/graph/badge.svg)](https://codecov.io/gh/roadrunner-server/goridge/)Goridge is high performance PHP-to-Golang codec library which works over native PHP sockets and Golang net/rpc package.
The library allows you to call Go service methods from PHP with a minimal footprint, structures and `[]byte` support.
PHP source code can be found in this repository: [goridge-php](https://github.com/roadrunner-php/goridge)
See https://github.com/roadrunner-server/roadrunner - High-performance PHP application server, load-balancer and process manager written in GolangFeatures
--------- no external dependencies or services, drop-in (64bit PHP version required)
- low message footprint (12 bytes over any binary payload), binary error detection
- CRC32 header verification
- sockets over TCP or Unix (ext-sockets is required), standard pipes
- very fast (300k calls per second on Ryzen 1700X over 20 threads)
- native `net/rpc` integration, ability to connect to existed application(s)
- standalone protocol usage
- structured data transfer using json
- `[]byte` transfer, including big payloads
- service, message and transport level error handling
- hackable
- works on Windows
- unix sockets powered (also on Windows)Installation
------------```go
GO111MODULE=on go get github.com/roadrunner-server/goridge/v3
```### Sample of usage
```go
package mainimport (
"fmt"
"net"
"net/rpc"goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc"
)type App struct{}
func (s *App) Hi(name string, r *string) error {
*r = fmt.Sprintf("Hello, %s!", name)
return nil
}func main() {
ln, err := net.Listen("tcp", ":6001")
if err != nil {
panic(err)
}_ = rpc.Register(new(App))
for {
conn, err := ln.Accept()
if err != nil {
continue
}
_ = conn
go rpc.ServeCodec(goridgeRpc.NewCodec(conn))
}
}
```License
-------The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information.