Coder Social home page Coder Social logo

pinoperation's Introduction

PINOperation

CocoaPods Carthage compatible Build status

Fast, concurrency-limited task queue for iOS and macOS.

Installation

Manually

Download the latest tag and drag the PINOperation folder into your Xcode project.

Install the docs by double clicking the .docset file under docs/, or view them online at cocoadocs.org

Git Submodule

git submodule add https://github.com/pinterest/PINOperation.git
git submodule update --init

CocoaPods

Add PINOperation to your Podfile and run pod install.

Carthage

Add the following line to your Cartfile and run carthage update --platform ios. Then follow this instruction of Carthage to embed the framework.

github "pinterest/PINOperation"

Requirements

PINOperation requires iOS 12.0, tvOS 12.0, macOS 10.13 or watchOS 4.0 and greater.

Contact

Garrett Moon

License

Copyright 2013 Tumblr, Inc. Copyright 2015 Pinterest, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

pinoperation's People

Contributors

adlai-holler avatar adlerj avatar dreampiggy avatar garrettmoon avatar jparise avatar maicki avatar martinpucik avatar nguyenhuy avatar rahul-malik avatar rcacheaux avatar rcancro avatar tstump-phunware avatar zhongwuzw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pinoperation's Issues

-waitUntilComplete Should Ensure Completion Block Is Called

Right now we use dispatch_group_notify to trigger the completion block to be called when the group is finished, and in -waitUntilComplete we use dispatch_group_wait. Since dispatch_group_notify runs asynchronously, we won't necessarily have executed the completion block before we return from waitUntilComplete.

So we need to simultaneously guarantee:

  • The completion block is run before waitUntilComplete returns.
  • The completion block is never run twice.
  • The completion block is run on the completion queue.

That'll mean that the completion block, if it's called due to waiting, will be run on whatever you call -waitUntilComplete from. We'll probably need to require that waitUntilComplete is called from the completion queue. Right now the completion queue is private (and unused) so we have plenty of API lee-way here.

Support serial queue

As I originally wrote PINOperationQueue, I couldn't think of a good reason to use it over a standard serial queue when you only want a max operation. Turns out there is a good reason, support for coalescing operations and canceling them. Support for priority seems dangerous: if a high priority task depended on a lower priority task it could cause a deadlock, so I would shy away from supporting priority.

Thread performance checker warning

I'm seeing runtime issue in console.

Stack trace:

Thread Performance Checker: Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 88617, TID: 1735210
Backtrace
=================================================================
3   libPINOperation_impl.dylib          0x00000001098ea2dc __44-[PINOperationQueue scheduleNextOperations:]_block_invoke.132 + 68
4   libdispatch.dylib                   0x000000010bb2c594 _dispatch_call_block_and_release + 24
5   libdispatch.dylib                   0x000000010bb2dd5c _dispatch_client_callout + 16
6   libdispatch.dylib                   0x000000010bb36040 _dispatch_lane_serial_drain + 928
7   libdispatch.dylib                   0x000000010bb36d80 _dispatch_lane_invoke + 428
8   libdispatch.dylib                   0x000000010bb44b40 _dispatch_workloop_worker_thread + 1720
9   libsystem_pthread.dylib             0x00000001af254b40 _pthread_wqthread + 284
10  libsystem_pthread.dylib             0x00000001af253904 start_wqthread + 8

Revise copyright section of README.md

It looks like this was copied over from PINCache, which started as a fork of Tumblr code. Because PINOperation is all new code, we don't need the Tumblr copyright note here.

Cocoapods trunk

** BUILD FAILED **

The following build commands failed:
	Ld */Xcode/DerivedData/App-bfxrhhepycrxtqefetrczqiyiiuh/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/PINOperation.build/Objects-normal/x86_64/Binary/PINOperation normal x86_64 (in target 'PINOperation' from project 'Pods')
	
	
	Error when CocoaPods trunk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.