Skip to content

Instantly share code, notes, and snippets.

View kierankelleher's full-sized avatar

Kieran Kelleher kierankelleher

  • Tampa, Florida, USA
View GitHub Profile
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
name: hello
spec:
ports:
- port: 3000
protocol: TCP
targetPort: 3000
@kierankelleher
kierankelleher / gist:1808397
Created February 12, 2012 13:11
EOEditingContext locking pattern
ec.lock();
try {
// work with ec here
} finally {
ec.unlock();
}
@kierankelleher
kierankelleher / gist:1808383
Created February 12, 2012 13:07
Utility methods to Create Manual-Locking EOEditingContext instances
/**
* ERXEC factory that creates anonymous manual locking ec subclasses in an app where
* safeLocking/autolocking is on by default. The returned ERXEC is
* guaranteed to not autolock.
*/
private static ERXEC.Factory manualLockingEditingContextFactory = new ERXEC.DefaultFactory() {
@Override
protected EOEditingContext _createEditingContext(EOObjectStore parent) {
return new ERXEC(parent == null ? EOEditingContext.defaultParentObjectStore() : parent) {