Skip to content

Instantly share code, notes, and snippets.

@yrashk
Created December 21, 2009 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yrashk/98fadf2f777b178ffbf0 to your computer and use it in GitHub Desktop.
Save yrashk/98fadf2f777b178ffbf0 to your computer and use it in GitHub Desktop.
% We currently have ONE simple_amqpfs_provider started
% New response collection/reducing policy for list_dir — collect all responses and concatenate them, instead of collecting first one and returning first one
% Other options are: {number, [X]} or {percentile, [X]} for collection policy
RespPol = amqpfs_response_policies:new([{list_dir,all,concat}]).
% =>
[{create,first,first},
{getattr,first,first},
{list_dir,all,concat},
{open,first,first},
{read,first,first},
{release,first,first},
{setattr,first,first},
{write,first,first}]
% Setting policy:
amqpfs_server:set_response_policies("/simple",RespPol).
% =>
ok
$ ls -la amqpfs/simple
total 0
drwxrwxrwx 2 yrashk yrashk 0 1969-12-31 16:00 .
drwxrwxrwx 5 yrashk yrashk 0 1969-12-31 16:00 ..
-rw-rw-rw- 1 yrashk yrashk 0 1969-12-31 16:00 file1
-rw-rw-rw- 1 yrashk yrashk 0 1969-12-31 16:00 file2
% Now launching second simple_amqpfs_provider:
amqpfs_provider:start(simple_amqpfs_provider,[{name,second}]).
$ ls -la amqpfs/simple
total 0
drwxrwxrwx 2 yrashk yrashk 0 1969-12-31 16:00 .
drwxrwxrwx 5 yrashk yrashk 0 1969-12-31 16:00 ..
-rw-rw-rw- 1 yrashk yrashk 0 1969-12-31 16:00 file1
-rw-rw-rw- 1 yrashk yrashk 0 1969-12-31 16:00 file1
-rw-rw-rw- 1 yrashk yrashk 0 1969-12-31 16:00 file2
-rw-rw-rw- 1 yrashk yrashk 0 1969-12-31 16:00 file2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment