;; -*- mode: outline; outline-regexp: " *[-\+]"; indent-tabs-mode: nil; fill-column: 120 -*-

todo
-----------

- add additional optional plan and request to method calls
 - example
 -

- build headers
 - provide static version in rgraphql
  - headers({})
   - build a text and set gql_headers


 - CORS
  - Access-Control-Allow-Origin: origin
   - get origin from request or *
  - Access-Control-Allow-Headers: *
   - if OPTIONS use value of request Access-Control-Request-Headers
  - Access-Control-Allow-Credentials: true
  - Access-Control-Max-Age: 3600


- HTTP/2
 - upgrade connection to http/2 (h2)
  - handle like current conneciton but by stream instead for writing
 -

- TLS
 - openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -days 365 -subj '/CN=localhost'
  - -nodes means no password


- graphql
 - validation

- refs
  - http://www.rubydoc.info/github/rack/rack/master/file/SPEC

- docs
 - yardoc
  - needs alterations
   - cp misc/glue-diagram.svg doc
   - cp misc/agoo_128.svg doc
   - edit doc/index.html
    - replace misc/agoo_128.svg with agoo_128.svg
    - replace misc/xxx_md.html with file.xxx.html

 - previous
  - rdoc -t Agoo -m README.md -x "test/*" -x "example/*" -x extconf.rb

use nice -n19 perfer when on same machine

- tests
 - cd test && tests.sh
 - bin/agoo -I ext -I lib -I example -r simple /simple@Simple
  - localhost:6464/simple
 - cd example && rackup -I ../ext -I ../lib -r agoo -s agoo
  - localhost:9292
 - cd example && ruby -I ../ext -I ../lib config.rb
  - localhost:9292
 - cd example && ruby -I ../ext -I ../lib hello.rb
  - localhost:6464/hello
 - cd example && ruby -I ../ext -I ../lib tls.rb
  - localhost:6465/hello
 - cd example/push && rackup -I ../../ext -I ../../lib -r agoo -s agoo
  - localhost:9292/websocket.html
  - localhost:9292/sse.html
 - cd example/push && ruby -I ../../ext -I ../../lib pubsub.rb
  - localhost:6464/websocket.html
  - localhost:6464/sse.html
 - cd example/push && ruby  -I ../../ext -I ../../lib push.rb
  - localhost:6464/websocket.html
  - localhost:6464/sse.html
 - cd example && ruby -I ../ext -I ../lib mem.rb
  - memory and performance with perfer
  - perfer -t 2 -c 100 -k http://127.0.0.1:6464/hello -d 30
  - top
 - cd example && ruby memx.rb
  - memory and performance with perfer, multiple workers
 - cd example/graphql && ruby  -I ../../ext -I ../../lib subscribe.rb
  - localhost:6464/websocket.html
  - localhost:6464/sse.html
  - curl -w "\n" -H "Content-Type: application/graphql" -d 'mutation{repeat(word: "foo")}' localhost:6464/graphql
  - curl -w "\n" -H "Content-Type: application/graphql" -d 'mutation{repeat(word: "bar")}' localhost:6464/graphql


- server log hook
 - log callback grabs gvl

- remote cluster
 - worker server
  - connect, maybe with some kind of security
  - server feeds to worker
   - as packets arrive from con
    - needs to attach a connection id to each packet
    - worker reassemples
   - or create packet on server and pick a worker to sent it to
    - maybe based on how many outstanding to that worker and most recent latency
     - multiple and pick lowest
    - packet is con id + len + request


- doesn't die
 - cd example/push && ruby  -I ../../ext -I ../../lib push.rb
  - localhost:6464/websocket.html
  - localhost:6464/sse.html
