<commit_before># ActorKit

[![Version](https://img.shields.io/cocoapods/v/ActorKit.svg?style=flat)](http://cocoadocs.org/docsets/ActorKit)
[![License](https://img.shields.io/cocoapods/l/ActorKit.svg?style=flat)](http://cocoadocs.org/docsets/ActorKit)
[![Platform](https://img.shields.io/cocoapods/p/ActorKit.svg?style=flat)](http://cocoadocs.org/docsets/ActorKit)
[![CI Status](http://img.shields.io/travis/jkrumow/ActorKit.svg?style=flat)](https://travis-ci.org/jkrumow/ActorKit)

A lightweight actor framework in Objective-C.

## Features

* Actors
* Actor Pools
* Synchronous and asynchronous invocations
* Promises
* Notification subscription and publication
* Supervision
* Linking

## Requirements

* iOS 8.0
* watchOS 2.0
* tvOS 9.0
* OS X 10.10

## Installation

ActorKit is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'ActorKit'
```

## Usage

Importing `<ActorKit/ActorKit.h>` provides you with the core functionality of the framework.

### Creating an Actor

Every subtype of `NSObject` can be turned into an actor:

```objc
Worker *worker = [[Worker alloc] initWithName:@"Bee"];
NSMutableArray *array = [NSMutableArray new];
```

### Sending Messages to Actors

To send a synchronous message to the actor precede the call with `sync`:

```objc
BOOL success = [worker.sync doSomething];
```

Send an asynchronous message to the actor use `async`:

```objc
[array.async removeAllObjects];
```

### Publishing notifications to other actors

Publish a notification with a payload:

```objc
[self publish:@"notification" payload:@5];<commit_msg>Update doc.<commit_after># ActorKit

[![Version](https://img.shields.io/cocoapods/v/ActorKit.svg?style=flat)](http://cocoadocs.org/docsets/ActorKit)
[![License](https://img.shields.io/cocoapods/l/ActorKit.svg?style=flat)](http://cocoadocs.org/docsets/ActorKit)
[![Platform](https://img.shields.io/cocoapods/p/ActorKit.svg?style=flat)](http://cocoadocs.org/docsets/ActorKit)
[![CI Status](http://img.shields.io/travis/jkrumow/ActorKit.svg?style=flat)](https://travis-ci.org/jkrumow/ActorKit)

A lightweight actor framework in Objective-C.

## Features

* Actors
* Actor Pools
* Synchronous and asynchronous invocations
* Promises
* Notification subscription and publication
* Supervision
* Linking

## Requirements

* iOS 8.0
* watchOS 2.0
* tvOS 9.0
* OS X 10.10

## Installation

ActorKit is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'ActorKit'
```

## Usage

Importing `<ActorKit/ActorKit.h>` provides you with the core functionality of the framework.

These objects are regular subtypes of `NSObject`:

```objc
Worker *worker = [[Worker alloc] initWithName:@"Bee"];
NSMutableArray *array = [NSMutableArray new];
```

As soon as you start sending messages to them in the fashion described below they will turn into actors automatically. There is nothing else you have to do.

### Sending Messages to Actors

To send a synchronous message to the actor precede the call with `sync`:

```objc
BOOL success = [worker.sync doSomething];
```

Send an asynchronous message to the actor use `async`:

```objc
[array.async removeAllObjects];
```

### Publishing notifications to other actors

Publish a notification with a payload:

```objc
[self publish:@"notification" payload:@5];
{'fraction_non_alphanumeric': 0.13772807533843437, 'fraction_numerical': 0.006474396703943496, 'mean_word_length': 5.317843866171004, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '584626', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1079, 'n_words': 306}