Created
January 7, 2018 01:30
-
-
Save jmercouris/6ced6e99634f2c10994753c679bacdb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defparameter *next-interface* nil) | |
(defparameter *character-conversion-table* (make-hash-table :test 'equalp)) | |
+(defparameter *json-promise* nil) | |
(defclass next-interface () | |
((window :accessor window :initarg :window) | |
@@ -221,12 +222,15 @@ | |
(print js-str-value) | |
(print js-str-length) | |
(print (cffi:convert-from-foreign js-str-length :unsigned-int)) | |
- (print (cffi:convert-from-foreign str-value :string+ptr))) | |
- nil) | |
+ (print (cffi:convert-from-foreign str-value :string+ptr)) | |
+ (lparallel:fulfill (cffi:convert-from-foreign str-value :string+ptr)))) | |
(defun web-view-execute (view script) | |
- (let ((np (cffi:null-pointer))) | |
- (webkit2:webkit-web-view-run-javascript view script np (cffi:callback callybacky) np))) | |
+ (setf *json-promise* (lparallel:promise)) | |
+ (synchronous-within-main | |
+ (let ((np (cffi:null-pointer))) | |
+ (webkit2:webkit-web-view-run-javascript view script np (cffi:callback callybacky) np)) | |
+ (lparallel:force *json-promise*))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment