• Stars
    star
    155
  • Rank 240,864 (Top 5 %)
  • Language
    Clojure
  • License
    Eclipse Public Li...
  • Created almost 10 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Extensions and helpers for core.async.

full.async

A Clojure and ClojureScript library that extends core.async with a number of convenience functions.

Clojars Project Build Status

Exception Handling

Exception handling is an area for which core.async doesn't have extensive support out of the box. If something within a go block throws an exception, it will be logged but the block will simply return nil, hiding any information about the actual exception. You could wrap the body of each go block within an exception handler but that's not very convenient. full.async provides a set of helper functions and macros for dealing with exceptions in a simple manner:

  • go-try: equivalent of go but catches any exceptions thrown and returns via the resulting channel
  • <?, alts?, <??: equivalents of <!, alts! and <!! but if the value is an exception, it will get thrown

Retry Logic

Sometimes it may be necessary to retry certain things when they fail, especially in distributed systems. The go-retry macro lets you achieve that, for example:

(go-retry
  {:should-retry-fn (fn [res] (= 409 (:status res)))
   :retries 3
   :delay 5}
  (<? (make-some-http-request>)))

The above method will invoke (<? (make-some-http-request>) in a go block. If it returns {:status 409}, go-retry will wait 5 seconds and try invoking (<? (make-some-http-request>) again. If it still fails after 3 attempts, the last will be returned via the result channel.

Sequences & Collections

Channels by themselves are quite similar to sequences however converting between them may sometimes be cumbersome. full.async provides a set of convenience methods for this:

  • <<!, <<?: takes all items from the channel and returns them as a collection. Must be used within a go block.
  • <<!!, <<??: takes all items from the channel and returns as a lazy sequence. Returns immediately.
  • <!*, <?*, <!!*, <??* takes one item from each input channel and returns them in a single collection. Results have the same ordering as input channels.

Parallel Processing

pmap>> lets you apply an async function (ie. function that returns channel) to channel's output with a specified parallelism, returning a new channel with results.

Debouncing

debounce>> takes input channel and only passes through values at specified rate, dropping the rest.

Conventions

For readability of code, full.async follows these conventions:

  • Async operators that throw exceptions use ? in place of !, for example throwing counterpart of <! is <?.
  • Functions that return channel that will contain zero or one value (typically result of go blocks) are sufixed with >. Similarly operators that expect zero/single value channel as input are prefixed with < (for example <?).
  • Functions that return channel that will contain zero to many values are sufixed with >>. Similarly operators that expect zero to many value channel as input are prefixed with << (for example <<?).

Change Log

See CHANGES.md.

License

Copyright (C) 2016 FullContact. Distributed under the Eclipse Public License, the same as Clojure.

More Repositories

1

fullcontact-api-ruby

A Ruby wrapper for the FullContact API
Ruby
82
star
2

hadoop-sstable

Splittable Input Format for Reading Cassandra SSTables Directly
Java
49
star
3

fullcontact-api-php

PHP bindings for the FullContact API
PHP
36
star
4

fullcontact4j

β›” [DEPRECATED] A Java client for the FullContact API
Java
28
star
5

full.monty

Minimalistic stack for building robust Clojure HTTP services.
16
star
6

fullcontact-excel

Excel workbook (and macro) for utilizing FullContact.
13
star
7

fullcontact-api-jquery-plugin

jQuery Plugin for FullContact
HTML
13
star
8

fullcontact-objc

[DEPRECATED] Objective-C library to access FullContact's v2 API endpoints via iOS and Mac OS X.
Objective-C
11
star
9

contacts-api-node

Node.js SDK for Contacts+ Contacts API
JavaScript
7
star
10

fullcontact-python-client

Official python client library for the fullcontact Enrich and Resolve APIs
Python
7
star
11

hesiod53

User management with Hesiod and Route53
Python
6
star
12

crankshaftd

Simple Go agent to ingest streaming data from Turbine via SSE and push it into StatsD as a gauge or to InfluxDB.
Go
6
star
13

ansible-hesiod

Ansible module to alter ssh authentication to follow hesiod dns rules
4
star
14

identity-resolution-interview-public

Scala
4
star
15

full.core

FullContact's Core Clojure library.
Clojure
4
star
16

proxinius

A FullContact API proxy service that randomly mutates responses.
Shell
4
star
17

full.db

FullContact SQL utils (Liquibase, and async db wrapper with korma and clojure.core.async)
Clojure
3
star
18

fullcontact-go

Official Go Client for FullContact V3 APIs
Go
3
star
19

airbrake-tornado

Airbrake notifier for Tornado
Python
3
star
20

full.cache

Clojure
2
star
21

full.rabbit

RabbitMQ helpers on top of langohr
Clojure
2
star
22

full.contacts-api-client

Clojure SDK for FullContact Contacts API
Clojure
2
star
23

fullcontact-api-tools

Command line tools for working with the FullContact API
Groovy
2
star
24

marshal

Marshal data serialization format and library [OSS]
Java
2
star
25

full.template

A leiningen template for a full.monty HTTP service
Clojure
2
star
26

full.http

Async HTTP client and server on top of http-kit and clojure.core.async
Clojure
2
star
27

fullcontact-java-client

Java client library for FullContact API
Java
1
star
28

camelsnake

String and keyword transformation between cases in Clojure.
Clojure
1
star
29

hesiod53-jumpcloud

Create a hesiod53 configuration file populated via jumpcloud
Python
1
star
30

icu-sys

Rust bindings to the ICU C API
C++
1
star
31

full.aws

Async clients for AWS
Clojure
1
star
32

statsproxy

Partitioning StatsD proxy for scaling StatsD to multiple nodes.
Go
1
star
33

fullcontact-node-sdk

Node.js SDK for FullContact Enrich APIs
JavaScript
1
star
34

contacts-api-dotnet

.NET SDK for FullContact Contacts API
C#
1
star