Comments (3)
So fn is provided out of the box for convenience but you could also try. impl Hook for YourType
and have a type specific to your application.
I've considered spawning a thread to fire hooks but I err'd on this side of letting users choose there own strategy because there a growing number of options out there and didn't want to be perspriptive. I also wanted to keep transitive dependencies low(er). All github requires is a 200 response. You could may maybe do a fire and forget hook that pushes deliveries to a channel and consume from the other end on a separate thread. There's a lot of options there so I didn't want to be prescriptive.
from afterparty.
The workaround for this is presumably to use an Arc<Mutex>
, which you use to get mutable access even from a Fn
. It's not terribly clean, but it'll work even if it turns out that a Fn
is indeed necessary. I suspect the reason for the Fn
requirement is that afterparty allows concurrent requests to its endpoints (if GitHub notifies you about two pushed at the same time for example), which fundamentally requires being able to call the function even if you only have a read-only borrow of it.
from afterparty.
BTW. Thanks for sharing that link I'm going to check out your project!
from afterparty.
Related Issues (20)
- Use thread pool for thread management
- Upgrade to serde 0.7
- parse errors on various events HOT 4
- example can not run HOT 5
- make code gen, gen less code HOT 2
- Provide std docker container HOT 1
- Add cargo rerun if changed to build output
- Possible timing attack vulnerability HOT 3
- Reduce overhead for deliveries not of interest
- Serde 0.9
- Porting to hyper 0.11 series HOT 5
- pull_request_review event HOT 7
- look into serde as alt for rustc serialize HOT 1
- use pines for printing process lines
- Redesign
- Maybe rep deploy payload as serde json value
- have code generate also generate tests
- Rm clap dep
- better structure for code generation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from afterparty.