crossbow 0.0.11 copy "crossbow: ^0.0.11" to clipboard
crossbow: ^0.0.11 copied to clipboard

Dart 1 only

Crossbow framework

Dart Crossbow #

Build Status

Crossbow is a library for building applications as a series of pipelines.

Crossbow principles:

  • Functions should never block
  • Code should be terse
  • Futures should be hidden
  • Defaults should be sensible
  • Prefer streams over lists

Example:

(
    Http.get('/user/{username}/trips')
    | DB.select(from: table(Trip).join(User), 
        where: (query, headers) =>
            query.path('user.username').equals(headers.path('username'))
                .orderBy('trip.date').descending()
                .list())
    | Convert.toJson()
    | Results.join(by: (headers, body) => headers['request'],
            as: JsonArray)
).start();

The example above will accept HTTP connections on port 8080 on the specified URL with placeholder 'username'. It will then perform a query for the type Trip using the path parameters. The results of the query will be streamed and converted to JSON as they come in. Then the results will be joined again by the request and streamed to the response as a JSON array.

0
likes
10
points
14
downloads

Publisher

unverified uploader

Weekly Downloads

Crossbow framework

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

box, exportable, io, reflective

More

Packages that depend on crossbow