wtf
This commit is contained in:
parent
7b4a511bdd
commit
c26d86411c
4 changed files with 43 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
.direnv
|
.direnv
|
||||||
|
sytest
|
||||||
|
node_modules
|
||||||
|
|
21
flake.nix
21
flake.nix
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
flakePkgs = rec {
|
flakePkgs = rec {
|
||||||
# client = pkgs.callPackage ./client { inherit toolchain; };
|
# client = pkgs.callPackage ./client { inherit toolchain; };
|
||||||
|
NetAsyncHTTPServer =
|
||||||
|
pkgs.perl536Packages.callPackage ./nix/NetAsyncHTTPServer.nix { };
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
packages = flake-utils.lib.flattenTree flakePkgs;
|
packages = flake-utils.lib.flattenTree flakePkgs;
|
||||||
|
@ -20,8 +22,25 @@
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
# inputsFrom = with flakePkgs; [ client ];
|
# inputsFrom = with flakePkgs; [ client ];
|
||||||
|
|
||||||
packages = (with pkgs; [ pkg-config ])
|
packages = (with pkgs; [ pkg-config perl openssl ])
|
||||||
++ (with toolchain; [ rustc cargo ]);
|
++ (with toolchain; [ rustc cargo ]);
|
||||||
|
# ++ (with pkgs.perl536Packages; [
|
||||||
|
# CPAN
|
||||||
|
# EmailMIME
|
||||||
|
# CryptEd25519
|
||||||
|
# DigestSHA1
|
||||||
|
# DigestHMAC
|
||||||
|
# DataDump
|
||||||
|
# EmailAddressXS
|
||||||
|
# FileSlurper
|
||||||
|
# Future
|
||||||
|
# IOAsync
|
||||||
|
# IOAsyncSSL
|
||||||
|
# JSON
|
||||||
|
# ListUtilsBy
|
||||||
|
# ModulePluggable
|
||||||
|
# NetAsyncHTTP
|
||||||
|
# flakePkgs.NetAsyncHTTPServer
|
||||||
|
|
||||||
LIBRARY_PATH = pkgs.lib.concatStringsSep ":" [ "${pkgs.zlib}/lib" ];
|
LIBRARY_PATH = pkgs.lib.concatStringsSep ":" [ "${pkgs.zlib}/lib" ];
|
||||||
|
|
||||||
|
|
15
nix/NetAsyncHTTPServer.nix
Normal file
15
nix/NetAsyncHTTPServer.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ buildPerlModule, lib, fetchurl, IOAsync, TestMetricsAny, HTTPMessage
|
||||||
|
, TestIdentity, TestRefcount }:
|
||||||
|
|
||||||
|
buildPerlModule {
|
||||||
|
pname = "Net-Async-HTTP";
|
||||||
|
version = "0.48";
|
||||||
|
src = fetchurl {
|
||||||
|
url =
|
||||||
|
"mirror://cpan/authors/id/P/PE/PEVANS/Net-Async-HTTP-Server-0.13.tar.gz";
|
||||||
|
sha256 = "sha256-yk3kcfIieNI5PIqy7G56xO8hfbRjXS3Mi6KoynIhFO4=";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ TestMetricsAny TestIdentity TestRefcount ];
|
||||||
|
propagatedBuildInputs = [ IOAsync HTTPMessage ];
|
||||||
|
}
|
|
@ -1,6 +1,11 @@
|
||||||
use tokio::sync::broadcast::{Receiver, Sender};
|
use tokio::sync::broadcast::{Receiver, Sender};
|
||||||
|
|
||||||
pub struct Message {}
|
pub struct UserId(String);
|
||||||
|
|
||||||
|
pub struct Message {
|
||||||
|
sender: UserId,
|
||||||
|
body: String,
|
||||||
|
}
|
||||||
|
|
||||||
pub type MessageTx = Sender<Message>;
|
pub type MessageTx = Sender<Message>;
|
||||||
pub type MessageRx = Receiver<Message>;
|
pub type MessageRx = Receiver<Message>;
|
||||||
|
|
Loading…
Reference in a new issue