Skip to content

Instantly share code, notes, and snippets.

View dgllghr's full-sized avatar

Dan dgllghr

View GitHub Profile
@dgllghr
dgllghr / read_stream.rs
Last active January 22, 2019 20:48
Async stream reader using csv-core and tokio
use bytes::Buf;
use std::io;
use tokio::prelude::*;
pub struct ReadStream<B> {
max_record_size: usize,
inbuf: Vec<u8>,
inbuf_offset: usize,
outbuf: Vec<u8>,
outbuf_offset: usize,
@dgllghr
dgllghr / MessageSequence.scala
Last active October 28, 2015 21:25 — forked from ericacm/MessageSequence.scala
Implements the Message Sequence pattern from EIP (http://www.eaipatterns.com/MessageSequence.html)
package akka.contrib.pattern
import java.util.UUID
import akka.actor.{Actor, ActorLogging, ActorRef, Cancellable}
import akka.serialization.SerializationExtension
import scala.collection.mutable
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._