Build or install nghttp2 (optionally with support for the --interval DURATION
flag).
Either:
brew install nghttp2
Or:
# This file contains the configuration for Credo and you are probably reading | |
# this after creating it with `mix credo.gen.config`. | |
# | |
# If you find anything wrong or unclear in this file, please report an | |
# issue on GitHub: https://github.com/rrrene/credo/issues | |
# | |
%{ | |
# | |
# You can have as many configs as you like in the `configs:` field. | |
configs: [ |
use actix::prelude::*; | |
use failure::Fallible; | |
use rdkafka::{ | |
consumer::stream_consumer::StreamConsumer, | |
message::OwnedMessage, | |
Message, | |
}; | |
pub struct MsgConsumer { | |
consumer: &'static StreamConsumer, |
use std::collections::HashMap; | |
use std::fmt; | |
use std::io; | |
use std::num::ParseFloatError; | |
use std::rc::Rc; | |
/* | |
Types | |
*/ |
Build or install nghttp2 (optionally with support for the --interval DURATION
flag).
Either:
brew install nghttp2
Or:
// Suppose you have a variable named `future` which implements the `Future` trait. | |
let future: impl Future = ...; | |
// This gist demonstrates how to run the future until completion using the `stdweb` crate. | |
// The various imports. | |
extern crate futures; | |
extern crate stdweb; |
Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups
command.
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe
Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.
Edit: This list is now maintained in the rust-anthology repo.
#!/bin/bash | |
# This script provides easy way to debug remote Erlang nodes that is running in a kubernetes cluster. | |
# Usage: ./erl-observe.sh -l app=my_all -n default -c erlang_cookie | |
# | |
# Don't forget to include `:runtime_tools` in your mix.exs application dependencies. | |
set -e | |
# Trap exit so we can try to kill proxies that has stuck in background | |
function cleanup { | |
echo " - Stopping kubectl proxy." |
// OK so to start with here's the EventHandler trait, just like slack-rs | |
pub trait EventHandler { | |
// I don't know what kind of thing EventData should be. | |
// maybe Json? whatever events actually are in phoenix. | |
fn on_event(&mut self, channel_name: &str, event_type: &str, event_data: EventData); | |
fn on_connect(&mut self, ...); | |
fn on_close(&mut self, ...); | |
} | |
fn login_and_run<H: EventHandler>(handler: H, ...) {...} |
defmodule Config do | |
@moduledoc """ | |
This module handles fetching values from the config with some additional niceties | |
""" | |
@doc """ | |
Fetches a value from the config, or from the environment if {:system, "VAR"} | |
is provided. | |
An optional default value can be provided if desired. |