This fixes SIGSEGV which happens when a promise gets resolved and
dies before the callback is registerred via then(). The latter assumes
that _promise must not be nullptr if the state is not resolved
yet. The dying promise should move the resolved state into the
future's local state.
The future/promise pair is for single-shot use only, which makes it
less useful for repetitive processing.
Add a stream/subscription abstraction, where a stream can produce data
which is repetitively consumed by the subscription. End-or-stream (or
error condition) is provided by a future.
Inspired by Dart's Stream class.
As the whole point of future/promise is to decouple the producer from the
consumer, available() is not generally useful. However it can still be
useful in special cases when we want to know who got there first.
One of them is deciding when to drop packets -- if the consumer is not
ready, and no queue space is available, we should just drop the packet
instead of waiting for the consumer.
Virtio net options:
--event-index arg (=on) Enable event_index feature (on / off)
By default, --event-index is enable. To disable, e.g.:
$ ./httpd --network-stack native --event-index off
Add a Dockerfile that can be used to build a development environment for
Seastar. This is useful for people such as myself who don't want to
install packages from Rawhide on my main development machine.
Steps to use it on Fedora:
1. Install Docker: http://docs.docker.com/installation/fedora/
$ sudo yum install docker-io
$ sudo systemctl start docker
$ sudo systemctl enable docker
[ Note: I had to edit /etc/sysconfig/docker to disable SELinux support
because I use BTRFS. ]
2. Build a Docker image:
$ docker build -t seastar-dev .
3. Launch a Docker instance:
[ Seastar git repository is located in $HOME/seastar on the host. ]
$ docker run -v $HOME/seastar/:/seastar -i -t seastar-dev /bin/bash
4. Build Seastar:
$ cd /seastar
$ make
5. Run an application:
$ ./build/release/apps/httpd/httpd
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Instead of having an std::vector<> manage the fragment array,
allocate it at the end of the impl struct and manage it manually.
The result isn't pretty but it does remove an allocation.