Skip to content

Instantly share code, notes, and snippets.

@eswdd
eswdd / BaseExecutionContextBuilder.java
Last active August 29, 2015 14:05
Cougar filters - detailed sketch
/**
* Base utils for building ExecutionContexts
*/
public abstract class BaseExecutionContextBuilder<T extends BaseExecutionContextBuilder> {
private BitSet whatsSet = new BitSet(MAX_BASE_BITS+getNumSpecificComponents());
protected GeoLocationDetails location;
protected RequestUUID uuid;
protected Date receivedTime;
@eswdd
eswdd / data.csv
Created January 30, 2014 09:30
timelines in gnuplot / html
1 2010-01-01 2010-01-31 2010-02-31
2 2011-01-01 2011-01-31 2010-02-31
3 2012-01-01 2012-01-31 2010-02-31
11 2010-01-01 2010-01-31 2010-02-31
12 2011-01-01 2011-01-31 2011-02-31
13 2012-01-01 2012-01-31 2012-02-31
@eswdd
eswdd / diffs.md
Last active August 29, 2015 13:55
java / .net differences

jit

  • java may decide to jit and will generally use execution data to aid optimisation
  • .net always uses jit and on first access, so can't use execution data to aid optimisation, so can at best be only as good as a c compiler (static compilation)
@eswdd
eswdd / spring-config.xml
Created December 22, 2013 13:57
How to configure a path alias in the jetty transport in Cougar 3.1. Add this snippet once for each alias into your application's spring context.xml.
...
<!-- add a path alias to the jetty transport -->
<bean parent="cougar.transport.HttpPathAliasIntroducer">
<constructor-arg index="1" value="/webping"/>
<constructor-arg index="2" value="/www/healthcheck/v3/summary"/>
</bean>
...
@eswdd
eswdd / ClientTimeAndTimeout.md
Last active December 31, 2015 05:59
Client timeout details

Some stuff

@eswdd
eswdd / RejectCalls.java
Last active December 29, 2015 14:19
Setting up a QoS interceptor to meet the usecase in https://github.com/betfair/cougar/issues/19
public class RejectCalls implements ExecutionPreProcessor {
private Set<String> toReject = new HashSet<String>();
public void setToReject(String s) {
for (String r : s.split(",")) {
toReject.add(r.trim());
}
}
@eswdd
eswdd / future_sample.rb
Last active December 24, 2015 11:29
Celluloid futures playing up?
require 'celluloid'
require 'celluloid/future'
def pusher(future)
sleep 5
future.signal 'Wibble'
end
def puller(future)
puts "Pulled: #{future.value}"