anchor.diff:  writer_init(From,Stream,SliceName) ->
   	% First ensure stream directory exists...
   	{ok,DataDir} = application:get_env(cake,data_dir),
  +	{ok,WriteDelay} = application:get_env(cake,write_delay),
   	Path = DataDir ++ binary_to_list(Stream) ++ "/",
   	filelib:ensure_dir(Path),
   	DataFile  = Path ++ SliceName ++ ".data",
   	IndexFile = Path ++ SliceName ++ ".index",
   	lager:debug("Data File:   ~p",[DataFile]),
   	lager:debug("Index File:  ~p",[IndexFile]),
  -	{ok,File}   = file:open(DataFile,[append,raw,{delayed_write, 50*1024*1024, 10000}]),  % Wait for 50MB of 10 seconds before flushing
  +        % Wait for 50MB or WriteDelay milliseconds before flushing
  +	{ok,File}   = file:open(DataFile,[append,raw,{delayed_write, 50*1024*1024, WriteDelay}]),
   	{ok,FileInfo} = file:read_file_info(DataFile),
   	{ok,Index}  = file:open(IndexFile,[append,raw]),
   
  
positive.code: 	 case file:read(DataFile,3) of
      	{ok,<<3,3,3>>} -> lager:info("Last message found at ~p in ~p, truncating file...",[Offset,FileName]),
      					  file:truncate(DataFile);
      	Data           -> fix_file(DataFile,NewOffset,FileName)
      end.
  
  
  
negative.code: 	after 5000 ->
  		% Routine maintenance 
  		erlang:garbage_collect(),
                  loop(Writer,DataList,ClearToSend,LastTS,Count,StreamName)
  	end.
  
  
  