[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/plz-event-source 436a615c64 05/22: Rename buffer and ht
From: |
ELPA Syncer |
Subject: |
[elpa] externals/plz-event-source 436a615c64 05/22: Rename buffer and http event source |
Date: |
Wed, 1 May 2024 09:58:48 -0400 (EDT) |
branch: externals/plz-event-source
commit 436a615c6469a9dcb8cc6bec71b0e06b3639c91d
Author: Roman Scherer <roman@burningswell.com>
Commit: Roman Scherer <roman@burningswell.com>
Rename buffer and http event source
---
plz-event-source.el | 16 ++++++++--------
tests/test-plz-event-source.el | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/plz-event-source.el b/plz-event-source.el
index 4f2cad0d23..9ab285378a 100644
--- a/plz-event-source.el
+++ b/plz-event-source.el
@@ -312,7 +312,7 @@
;; Buffer event source
-(defclass plz-buffer-event-source (plz-event-source)
+(defclass plz-event-source-buffer (plz-event-source)
((buffer
:initarg :buffer
:documentation "The event source buffer."
@@ -323,7 +323,7 @@
:type (or null plz-event-source-parser)))
"A server sent event source using curl for HTTP.")
-(cl-defmethod plz-event-source-insert ((source plz-buffer-event-source) data)
+(cl-defmethod plz-event-source-insert ((source plz-event-source-buffer) data)
"Insert DATA into the event SOURCE buffer, parse and dispatch events."
(with-slots (parser) source
(plz-event-source-parser-insert parser data)
@@ -338,7 +338,7 @@
(re-search-forward plz-http-end-of-headers-regexp nil t)
(point)))
-(cl-defmethod plz-event-source-open ((source plz-buffer-event-source))
+(cl-defmethod plz-event-source-open ((source plz-event-source-buffer))
"Open a connection to the URL of the event SOURCE."
(with-slots (buffer errors options ready-state parser) source
(with-current-buffer (get-buffer-create buffer)
@@ -351,7 +351,7 @@
(plz-event-source-dispatch-event source event)
source))))
-(cl-defmethod plz-event-source-close ((source plz-buffer-event-source))
+(cl-defmethod plz-event-source-close ((source plz-event-source-buffer))
"Close the connection of the event SOURCE."
(with-slots (buffer ready-state) source
(let ((event (plz-event-source-event :type 'close)))
@@ -359,7 +359,7 @@
(plz-event-source-dispatch-event source event)
source)))
-(defclass plz-http-event-source (plz-event-source)
+(defclass plz-event-source-http (plz-event-source)
((process
:initarg :process
:documentation "The process of the event source."
@@ -376,7 +376,7 @@
(let ((media-type (plz-media-type:text/event-stream :events handlers)))
(cons (cons 'text/event-stream media-type) plz-media-types))))
-(cl-defmethod plz-event-source-open ((source plz-http-event-source))
+(cl-defmethod plz-event-source-open ((source plz-event-source-http))
"Open a connection to the URL of the event SOURCE."
(with-slots (errors options process ready-state response url) source
(setf ready-state 'connecting)
@@ -395,7 +395,7 @@
(setf ready-state 'closed))))
source))
-(cl-defmethod plz-event-source-close ((source plz-http-event-source))
+(cl-defmethod plz-event-source-close ((source plz-event-source-http))
"Close the connection of the event SOURCE."
(with-slots (process ready-state) source
(delete-process process)
@@ -438,7 +438,7 @@ callbacks will always be set to nil.")
:status (plz-response-status chunk)
:headers (plz-response-headers chunk)))
(source (plz-event-source-open
- (plz-buffer-event-source
+ (plz-event-source-buffer
:buffer (buffer-name (process-buffer process))
:handlers (seq-map
(lambda (pair)
diff --git a/tests/test-plz-event-source.el b/tests/test-plz-event-source.el
index f455877aee..752f29575f 100644
--- a/tests/test-plz-event-source.el
+++ b/tests/test-plz-event-source.el
@@ -188,7 +188,7 @@
:data "This is the second message, it\nhas two lines."
:origin (buffer-name)))
(all-events) (close-events) (error-events) (message-events)
(open-events)
- (source (plz-buffer-event-source
+ (source (plz-event-source-buffer
:buffer (buffer-name)
:handlers `((open . ,(lambda (source event)
(push event open-events)
@@ -239,7 +239,7 @@
(ert-deftest test-plz-event-source-http-event-source ()
(plz-event-source-test-with-mock-response (plz-event-source-test-response
"text/event-stream/openai-hello.txt")
(let* ((all-events) (close-events) (error-events) (message-events)
(open-events)
- (source (plz-http-event-source
+ (source (plz-event-source-http
:url "https://api.openai.com/v1/chat/completions"
:options `((body . ,(json-encode
'(("model" . "gpt-3.5-turbo")
- [elpa] branch externals/plz-event-source created (now 544432be2d), ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source b33496a593 02/22: Remove plz-media-type.el, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source 47fff98c63 06/22: Rename text/event-stream media type, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source b25a8bd7c8 07/22: Fix checkdoc issues, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source 540072367a 03/22: Remove plz.el, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source 92a81ca775 04/22: Use .git to locate dominating file, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source 436a615c64 05/22: Rename buffer and http event source,
ELPA Syncer <=
- [elpa] externals/plz-event-source 8e1b769f08 20/22: Tweak vendor note, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source 544432be2d 22/22: Split manual and README, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source a1f3cc7da9 14/22: Prefix parser functions with plz-event-source-parser, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source abfc1f5271 18/22: Run tests on 29.3 as well, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source ae322c21ed 01/22: Initial commit, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source 1c108a456a 15/22: Move private function, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source 7d3c6a19d2 17/22: Update example in README, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source 558ba9a77e 19/22: Add vendor note, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source de99b89df6 21/22: ELPA preparations, ELPA Syncer, 2024/05/01
- [elpa] externals/plz-event-source 471a01eb83 10/22: Run handler code via a timer in the main loop, ELPA Syncer, 2024/05/01