Skip to content

Add Rustler NIF for Elixir wRPC bindings - #1

Draft
scrogson with Copilot wants to merge 3 commits into
mainfrom
copilot/build-rustler-nif-for-wrpc
Draft

Add Rustler NIF for Elixir wRPC bindings#1
scrogson with Copilot wants to merge 3 commits into
mainfrom
copilot/build-rustler-nif-for-wrpc

Conversation

Copilot AI commented Dec 1, 2025

Copy link
Copy Markdown

Implements Elixir NIF bindings for the wRPC transport layer, enabling Elixir applications to invoke WIT functions over TCP.

Changes

  • Rust NIF (native/wrpc_nif/) - Wraps wrpc-transport TCP client using Rustler

    • Lazy-initialized Tokio runtime for async operations
    • Resource-based client handle management
    • DirtyCPU scheduler for blocking invoke calls
  • Elixir API (lib/wrpc/)

    • Wrpc.Tcp.connect/1 - Create TCP client connections
    • Wrpc.invoke/4 - Invoke remote WIT functions

Usage

{:ok, client} = Wrpc.Tcp.connect("127.0.0.1:7761")
{:ok, result} = Wrpc.invoke(client, "wrpc-examples:hello/handler", "hello", <<>>)

Dependencies

  • rustler ~> 0.34.0
  • wrpc-transport 0.28 (Rust)
  • tokio 1.x (Rust)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)
  • https://api.github.com//advisories
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)
  • https://api.github.com/repos/bytecodealliance/wrpc
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • repo.hex.pm
    • Triggering command: /usr/lib/erlang/erts-13.2.2.5/bin/inet_gethost 4 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

https://github.com/bytecodealliance/wrpc

Build a rustler NIF for Elixir to use wRPC


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 1, 2025 00:52
Co-authored-by: scrogson <53274+scrogson@users.noreply.github.com>
Co-authored-by: scrogson <53274+scrogson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add rustler NIF for Elixir integration with wRPC Add Rustler NIF for Elixir wRPC bindings Dec 1, 2025
Copilot AI requested a review from scrogson December 1, 2025 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants