jlouis/fuse

Please include a fully working example

Opened this issue · 2 comments

Would it be possible to include a complete example(s) as source?

Yes it would. Do you have a small example in mind which is rather self-contained and still useful? I was thinking about something where you had a database connection, but it easily ends up being large and contrived for an example.

So I am all for it, but I do think we should figure out what a good example would comprise.

ferd commented

@jlouis use a simple thing like a dumb web server:

$ while true ; do  echo -e "HTTP/1.1 200 OK\r\nConnection:close\r\nContent-Length: ${#$(date)}\r\n\r\n$(date)" | nc -l -p 8081 ; done

(I use that to test dumb proxying/load-balancing modes here).

Put HTTP calls to localhost:8081 behind a fuse, and have fun taking the server up and down by killing the process. The fuse should tell you when it's entirely down to stop connecting.

For the fun of it, boot a second server on 8082, and have them output their name or something. Consider this to be switching from 'primary to replica' or from 'geographically close to in another datacenter" as a failover. Trigger the switch on failure, or by putting sleep time in the first server to simulate overload (and long time to respond).